Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saqibmehmoodgit/f49d9c9d74e4e8fd949ab083eb29c311 to your computer and use it in GitHub Desktop.
Save saqibmehmoodgit/f49d9c9d74e4e8fd949ab083eb29c311 to your computer and use it in GitHub Desktop.
Interface BatchPreparedStatementSetter
int getBatchSize()
void setValues(PreparedStatement ps, int i)
return this.jdbcTemplate.batchUpdate(
"update books set firstName = ? where id = ?",
new BatchPreparedStatementSetter() {
public void setValues(PreparedStatement ps, int i)
throws SQLException {
ps.setLong( 1, student.get(i).getId());
}
public int getBatchSize() {
return student.size();
} });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment