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