标签:style io ar color sp strong on bs size
public int[] updateBatchByjdbc(final List<String[]> ids) {
int[] updateCounts = this.getJdbcTemplate().batchUpdate(
"update CS_ORDER set AUDIT_STATUS=? where id = ?",
new BatchPreparedStatementSetter() {
@Override
public void setValues(PreparedStatement ps, int i)
throws SQLException {
ps.setString(1, ids.get(i)[0]);
ps.setString(2, ids.get(i)[1]);
}
@Override
public int getBatchSize() {
return ids.size();
}
});
return updateCounts;
}
i=getBatchSize() //决定循环次数
标签:style io ar color sp strong on bs size
原文地址:http://my.oschina.net/u/1778309/blog/346057