sql = "";
sql = "insert into TBL_CMF_USERTELBOOK values (?,?,?,?,sysdate,sysdate,?,?)";
BatchPreparedStatementSetter batchpss = new BatchPreparedStatementSetter() {
public int getBatchSize() {
return telBooks.size();
}
public void setValues(PreparedStatement ps, int index)
throws SQLException {
TelBook telBook = new TelBook();
telBook = telBooks.get(index);
ps.setLong(1, telBook.getAccountId());
ps.setString(2, telBook.getContactNum());
ps.setLong(3, telBook.getIsValidate());
ps.setInt(4, 1);
ps.setLong(5, telBook.getFriendId());
ps.setString(6, telBook.getFriendName());
}
};
this.getJdbcTemplate().batchUpdate(sql, batchpss);
阅读(1879) | 评论(0) | 转发(0) |