ways: using question marks ( ? ) as placeholders for the values or using named parameters ( :name , for
example) as placeholders. Each of these two options requires a slightly different approach in populating
the values. You start with the question mark as shown in the sample SQL statement in Listing 9-23.
Listing 9-23. Prepared Statement for Inserting into the Customer Table
insert into customer (firstName, middleInitial, lastName, address, city,
state, zip) values (?, ?, ?, ?, ?, ?, ?)
As you can see, there is nothing unusual about the prepared statement. However, providing the SQL
statement is only one of the configuration options for JdbcBatchItemWriter . Table 9-3 lists all the
Table 9-3. JdbcBatchItemWriter Configuration Options
If true, causes
JdbcBatchItemWriter to validate
that every item resulted in an
insert or update. If any item didn't
trigger an insert or an update of a
on is thrown.