private int save() {
String sql = " insert into bj_pre_casebaseinfo (caseno,applicantitemname,caseapplicanttype,caseapplicant,caseapplicantpapertype,caseapplicantpapercode,caseapplicantmobile,caseapplicantphone," +
" caseapplicantzipcode,caseapplicantemail,caseapplicantaddress,caselinkmanname,legalperson,caselinkmanpapertype,caselinkmanpapercode,caselinkmanmobile,caselinkmanaddress) " +
" values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
try {
jdbcTemplate.batchUpdate(sql, new BatchPreparedStatementSetter() {
@Override
public void setValues(PreparedStatement ps, int i) throws SQLException {
ps.setString(1, BjCasebaseinfos.get(i).getCaseno());
ps.setString(2,BjCasebaseinfos.get(i).getApplicantitemname());
ps.setString(3, BjCasebaseinfos.get(i).getCaseapplicanttype());
ps.setString(4, BjCasebaseinfos.get(i).getCaseapplicant());
ps.setString(5, BjCasebaseinfo
Spring利用jdbcTemplate批量添加
最新推荐文章于 2024-05-29 21:27:00 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)