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
This commit is contained in:
Phillip Webb
2012-11-05 14:48:15 -08:00
parent c92ef13979
commit 583819ca5f

View File

@@ -1516,14 +1516,6 @@ dataSource.setPassword("");</programlisting>
}
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(
"update t_actor set first_name = ?, last_name = ? where id = ?",
actors,