62,614
社区成员
发帖
与我相关
我的任务
分享
SqlParameterSource[] batch = SqlParameterSourceUtils.createBatch(list.toArray());
try {
int[] affectedRows = namedParameterJdbcTemplate.batchUpdate(SQL, batch);
} catch (Exception e) {
if (e instanceof BatchUpdateException)
logger.info("SSDSDSDSD");
logger.error("",e);
}
你既然想要批量插入,就得保证这50条sql是正确的,批量插入都是一起提交一起回滚的