Skip to content

Commit 52a1fc4

Browse files
committed
Polish BatchPreparedStatementSetter example in reference manual
Closes gh-24084
1 parent 5648ef3 commit 52a1fc4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/docs/asciidoc/data-access.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3848,9 +3848,10 @@ based on entries in a list, and the entire list is used as the batch:
38483848
"update t_actor set first_name = ?, last_name = ? where id = ?",
38493849
new BatchPreparedStatementSetter() {
38503850
public void setValues(PreparedStatement ps, int i) throws SQLException {
3851-
ps.setString(1, actors.get(i).getFirstName());
3852-
ps.setString(2, actors.get(i).getLastName());
3853-
ps.setLong(3, actors.get(i).getId().longValue());
3851+
Actor actor = actors.get(i);
3852+
ps.setString(1, actor.getFirstName());
3853+
ps.setString(2, actor.getLastName());
3854+
ps.setLong(3, actor.getId().longValue());
38543855
}
38553856
public int getBatchSize() {
38563857
return actors.size();

0 commit comments

Comments
 (0)