SoFunction
Updated on 2025-03-09

JDBC writes data in large batches to SQLServer2000, and the number of records is greater than 10,000


("sessionFactory1");
SimpleDateFormat fomat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Session s=null;
s=().openSession();
Connection con=();
Statement stmt = null;
try {
stmt=();
(false);
Iterator it=();
int iCount = 1;
long start = ();
while(()){
TResultWaterZId t = (TResultWaterZId)();
StringBuffer sb = new StringBuffer();
("insert into T_result_water_z(schemeid,stcd,z,tm) values('");
(()).append("','").append(()).append("','");
(()).append("','").append((())).append("')");
(());
if(iCount % 1000 == 0){
();
();
}
iCount++;
}
();
();
();
long end = ();
("addTResultWaterZId used time:"+(end-start));
();
();
} catch (SQLException e) {
try {
();
} catch (SQLException e1) {
();
}
();
}finally{
try {
();
();
} catch (SQLException e) {
();
}
}