java 記事本數據 批量插入
public int insert(final List<policycar> list) {
this.getSqlMapClientTemplate().execute(new SqlMapClientCallback() {
public Object doInSqlMapClient(SqlMapExecutor arg0) throws SQLException {
arg0.startBatch();
for(int i=0,count=list.size();i<count;i++)
{
arg0.insert("insertpol", list.get(i));
}
arg0.executeBatch();
return 1;
}
});
return 0;
}
posted on 2012-04-20 15:47 歐陽良才 閱讀(312) 評論(0) 編輯 收藏 所屬分類: JAVA