From 52a1fc4329d6d97fb4a1e1832c74393dcc4f72e9 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 29 Nov 2019 18:50:42 +0100 Subject: [PATCH] Polish BatchPreparedStatementSetter example in reference manual Closes gh-24084 --- src/docs/asciidoc/data-access.adoc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/docs/asciidoc/data-access.adoc b/src/docs/asciidoc/data-access.adoc index 6cb8f23a43..b68323099f 100644 --- a/src/docs/asciidoc/data-access.adoc +++ b/src/docs/asciidoc/data-access.adoc @@ -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();