@Test
public void clockingIn_Img() throws Exception{
DbJdbc idb = DbMaster.getIDB("JXT");
List<Jxt_pay_info> pays=idb.getBeanList("select top 100000 * from jxt_pay_info", Jxt_pay_info.class);
//可以用idb进行测试了。。。。
//大数据插入方式
String sql = "insert into Jxt_pay_info1 (id ,card_id ,pay_money ,pay_time ,pay_date ,pay_address ,school_id ,source_id ,lasttime ,card_sn,paid_after) values (?,?,?,?,?,?,?,?,?,?,?)";
Connection connection = idb.DbConnection;
PreparedStatement ps = connection.prepareStatement(sql);
final int batchSize = 1000;
int count = 0;
long start=System.currentTimeMillis();
System.err.println("Start");
for (Jxt_pay_info pay: pays) {
ps.setInt(1, pay.getId());
ps.setString(2, pay.getCard_id());
ps.setFloat(3, pay.getPay_money());
ps.setString(4, pay.getPay_time());
ps.setString(5, pay.getPay_date());
ps.setString(6, pay.getPay_address());
ps.setString(7, pay.getSchool_id());
ps.setString(8, pay.getSource_id());
ps.setString(9, pay.getLasttime());
ps.setInt(10, pay.getCard_sn());
ps.setString(11, pay.getPaid_after());
ps.addBatch();
}
ps.executeBatch(); // insert remaining records
ps.close();
connection.close();
DbMaster.closeIDB(idb);
long end=System.currentTimeMillis();
System.err.println("End"+(end-start));
}
}