Gets called by SqlMapTemplate.execute with an active JDBC Connection.
Does not need to care about the lifecycle of the Connection or handling transactions.
If called without a thread-bound JDBC transaction (initiated by
DataSourceTransactionManager), the code will simply get executed on the
underlying JDBC connection with its transactional semantics.
If SqlMapTemplate is configured to use a JTA-aware DataSource,
the JDBC connection and thus the callback code will be transactional
if a JTA transaction is active.
Allows for returning a result object created within the callback, i.e.
a domain object or a collection of domain objects. A thrown RuntimeException
is treated as application exception, it gets propagated to the caller of the
template.
- Parameters:
- stmt - the iBATIS Database Layer mapped statement
- con - the JDBC Connection to work on
- Returns: a result object, or null if none
- Throws:
- SQLException - if thrown by MappedStatement methods