@Autowired private NamedParameterJdbcTemplate namedParameterJdbcTemplate; public void batchUpdate(List<User> list) { if(CollectionUtils.isNotEmpty(list)) { String sql = "INSERT INTO USER (NAME, TEL, ADDR) VALUES( :name, :tel, :addr)"; SqlParameterSource[] batchArgs = SqlParameterSourceUtils.createBatch(list.toArray()); nameJdbcTemplateOracle.batchUpdate(sql, batchArgs); } } @lombok.Data public class SupStoreInfo{ private String name; private String tel; private String addr; }
文章標籤
全站熱搜
留言列表