日期:2014-05-16 浏览次数:20755 次
public static int BatchSave(List list) { int len =0; try{ try{ sqlclient.startTransaction(); sqlclient.startBatch(); for(int i=0;i<list.size();i++) { sqlclient.insert("insertBatch",list.get(i)); } len = sqlclient.executeBatch(); sqlclient.commitTransaction(); }finally{ sqlclient.endTransaction(); } }catch(SQLException sqlex){ System.out.println("sqlex:-> "+sqlex.getMessage()); } return len; }