for (int i = 0; i<size; i++) {
String sql_add_pingzdy = "INSERT INTO cfgdb..CFG_PING_TEST_JOB(JOB_ID,TEST_INTERVAL_TIME,TEST_CNT,SERVER,MAX_CONNECT_TIME_LIMIT,DEV_ID,ALLNETFLAG,PACK_CNT_LIMIT,COLLECTOR_ID,DEV_ALIAS) VALUES(?,?,?,?,?,?,?,?,?,?)"
.toString();
psmt = DBConnection.getPreStatement(sql_add_pingzdy);//这个是从连接池里取一连接
psmt.getConnection().setAutoCommit(false);
for(int j=0; j<elementList.size(); j++){
psmt.setInt(1, Integer.parseInt(jobid));
psmt.setInt(2, Integer.parseInt(jiange));
psmt.setInt(3, Integer.parseInt(cnt));
psmt.setString(4, (String)elementList.get(j));
psmt.setDouble(5, Double.parseDouble(contimelimit));
psmt.setInt(6, 1);
psmt.setString(7, "2");
psmt.setInt(8, Integer.parseInt(pcnt));
psmt.setInt(9, Integer.parseInt(collector));
psmt.setString(10, "自定义网址");
psmt.setString(11, ((ConfigBean)localipList.get(i)
.getClientProperty("configBean")).getServerip());

psmt.addBatch();
}
psmt.executeBatch();//在此卡住
psmt.getConnection().commit();
我在断点调试的时候,走到psmt.executeBatch()就不往下执行了,卡住不动了,不知道为什么,请高手指教!
在这里,问号的替换时没有问题的