spring2.0.8 批量处理

  1. publicint[]updateKscj(finalString[]bmglids,finaldouble[]llbzs,finaldouble[]llzys,finaldouble[]scs){
  2. int[]updateCounts=super.getJdbcTemplate().batchUpdate(
  3. "updatexj_bmglsetbmgl_llbz=?,bmgl_llzy=?,bmgl_llzf=?,bmgl_sc=?wherebmgl_id=?",
  4. newBatchPreparedStatementSetter(){
  5. publicvoidsetValues(PreparedStatementps,inti)throwsSQLException{
  6. ps.setDouble(1,llbzs[i]);
  7. ps.setDouble(2,llzys[i]);
  8. ps.setDouble(3,llbzs[i]+llzys[i]);
  9. ps.setDouble(4,scs[i]);
  10. ps.setString(5,bmglids[i]);
  11. }
  12. publicintgetBatchSize(){
  13. returnbmglids.length;
  14. }
  15. });
  16. returnupdateCounts;
  17. }

你可能感兴趣的:(spring)