Fix batch operations sample in reference docs

Remove superfluous code from the sample in section 13.4.3 of the
JDBC reference guide.

Issue: SPR-9937
master
Phillip Webb 12 years ago
parent c92ef13979
commit 583819ca5f
  1. 8
      src/reference/docbook/jdbc.xml

@ -1516,14 +1516,6 @@ dataSource.setPassword("");</programlisting>
} }
public int[][] batchUpdate(final Collection&lt;Actor&gt; actors) { public int[][] batchUpdate(final Collection&lt;Actor&gt; actors) {
Collection&lt;Object[]&gt; batch = new ArrayList&lt;Object[]&gt;();
for (Actor actor : actors) {
Object[] values = new Object[] {
actor.getFirstName(),
actor.getLastName(),
actor.getId()};
batch.add(values);
}
int[][] updateCounts = jdbcTemplate.batchUpdate( int[][] updateCounts = jdbcTemplate.batchUpdate(
"update t_actor set first_name = ?, last_name = ? where id = ?", "update t_actor set first_name = ?, last_name = ? where id = ?",
actors, actors,

Loading…
Cancel
Save