Polish BatchPreparedStatementSetter example in reference manual
Closes gh-24084
This commit is contained in:
@@ -3848,9 +3848,10 @@ based on entries in a list, and the entire list is used as the batch:
|
||||
"update t_actor set first_name = ?, last_name = ? where id = ?",
|
||||
new BatchPreparedStatementSetter() {
|
||||
public void setValues(PreparedStatement ps, int i) throws SQLException {
|
||||
ps.setString(1, actors.get(i).getFirstName());
|
||||
ps.setString(2, actors.get(i).getLastName());
|
||||
ps.setLong(3, actors.get(i).getId().longValue());
|
||||
Actor actor = actors.get(i);
|
||||
ps.setString(1, actor.getFirstName());
|
||||
ps.setString(2, actor.getLastName());
|
||||
ps.setLong(3, actor.getId().longValue());
|
||||
}
|
||||
public int getBatchSize() {
|
||||
return actors.size();
|
||||
|
||||
Reference in New Issue
Block a user