spring处理批量操作
public void addOtherSimDnBatch(final List dns, final int cityid,final int agentlId) {System.out.println("---------------------addOtherSimDnBatch-------------------------"); BatchPreparedStatementSetter setter=new BatchPreparedStatementSetter () { public void setValues(PreparedStatement pstmt,int i) throws SQLException{ String dn = (String)dns.get(i); pstmt.setString(1,dn); pstmt.setInt(2,cityid); pstmt.setInt(3,agentlId); } public int getBatchSize(){ return dns.size(); } }; getJdbcTemplate().batchUpdate(new SQLProxy(INSERT_OTHERSIMDN_BATCH).sql(), setter);