01: package liquibase.database.template;
02:
03: import liquibase.exception.JDBCException;
04:
05: import java.sql.CallableStatement;
06: import java.sql.SQLException;
07:
08: /**
09: * Generic callback interface for code that operates on a CallableStatement.
10: * Allows to execute any number of operations on a single CallableStatement,
11: * for example a single execute call or repeated execute calls with varying
12: * parameters.
13: *
14: * @author Spring Framework
15: */
16: interface CallableStatementCallback {
17:
18: /**
19: * Gets called by <code>JdbcTemplate.execute</code> with an active JDBC
20: * CallableStatement. Does not need to care about closing the Statement
21: * or the Connection, or about handling transactions: this will all be
22: * handled by Spring's JdbcTemplate.
23: * @param cs active JDBC CallableStatement
24: * @return a result object, or <code>null</code> if none
25: * @throws SQLException if thrown by a JDBC method, to be auto-converted
26: * into a DataAccessException by a SQLExceptionTranslator
27: * @throws JDBCException in case of custom exceptions
28: */
29: Object doInCallableStatement(CallableStatement cs)
30: throws SQLException;
31:
32: }
|