2024年3月28日发(作者:)

import tion;

import Manager;

import edStatement;

import Set;

import eption;

import ;

import ;

/**

* 批量更新数据

* ClassName: MyLogger

* @Description: TODO

* @author SUNZK-QQ:1131341075-WEIXIN:DreamSunlight88

* @date 2016-3-23

*/

public class MyLogger {

private static final String url = "jdbc:mysql://127.0.0.1:3306/student";

private static final String userName = "root";

private static final String password = "123456";

private static final int size = 5;

public static void commitBatch(){

try {

e("");

Connection conn= nection(url, userName, password);

oCommit(false);

String sql = "insert content(ip,website,yyyymmdd,hour,object_id)

values(?,?,?,?,?)";

PreparedStatement prest =

eStatement(sql,_SCROLL_SENSITIVE,_READ

_ONLY);

for(int x = 0; x < size; x++){

int index = 1;

ing(index++, "192.168.1.1");

ing(index++, "localhost");

ing(index++, "20081009");

(index++, 8);

ing(index++, "11111111");

ch();

}

}

eBatch();

();

();

} catch (SQLException ex1) {

ger(e());

} catch (ClassNotFoundException ex) {

ger(e());

}

}

public static void main(String[] args){

commitBatch();

}