Code using this class need only implement callback interfaces, giving
them a clearly defined contract. The PreparedStatementCreator callback
interface creates a prepared statement given a Connection provided by this
class, providing SQL and any necessary parameters. The RowCallbackHandler
interface extracts values from each row of a ResultSet.
Can be used within a service implementation via direct instantiation
with a DataSource reference, or get prepared in an application context
and given to services as bean reference. Note: The DataSource should
always be configured as a bean in the application context, in the first case
given to the service directly, in the second case to the prepared template.
The motivation and design of this class is discussed
in detail in
Expert One-On-One J2EE Design and Development
by Rod Johnson (Wrox, 2002).
Because this class is parameterizable by the callback interfaces and
the SQLExceptionTranslator interface, it isn't necessary to subclass it.
All operations performed by this class are logged at debug level.