代码实现:
public void insertVarMailTabData(final List varList) throws PafaDAOException {
this.getSqlMapClientTemplate().execute(new SqlMapClientCallback() {
public Object doInSqlMapClient(SqlMapExecutor executor) throws SQLException {
executor.startBatch();
for (int i = 0; i < varList.size(); i++) {
EmailtempVariableDTO evDto = (EmailtempVariableDTO) varList.get(i);
executor.insert("insertVarMailTabData", evDto);
}
executor.executeBatch();
return null;
}
});
}
其他参考文章:
http://www.longtask.com/blog/?p=172(spring+ibatis 批量提交数据提升性能)