Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
StatementCallback |
|
| 1.0;1 |
1 | package liquibase.executor.jvm; | |
2 | ||
3 | import liquibase.exception.DatabaseException; | |
4 | import liquibase.statement.SqlStatement; | |
5 | ||
6 | import java.sql.SQLException; | |
7 | import java.sql.Statement; | |
8 | ||
9 | /** | |
10 | * Generic callback interface for code that operates on a JDBC Statement. Allows to execute any number of operations on | |
11 | * a single Statement, for example a single <code>executeUpdate</code> call or repeated <code>executeUpdate</code> calls | |
12 | * with varying SQL. | |
13 | * <p/> | |
14 | * <p> | |
15 | * Used internally by JdbcTemplate, but also useful for application code. | |
16 | * | |
17 | * @author Spring Framework | |
18 | */ | |
19 | interface StatementCallback { | |
20 | ||
21 | /** | |
22 | * Gets called by <code>JdbcTemplate.execute</code> with an active JDBC Statement. Does not need to care about | |
23 | * closing the Statement or the Connection, or about handling transactions: this will all be handled by | |
24 | * JdbcTemplate. | |
25 | * <p/> | |
26 | * | |
27 | * @param stmt | |
28 | * active JDBC Statement | |
29 | * @return a result object, or <code>null</code> if none | |
30 | */ | |
31 | Object doInStatement(Statement stmt) throws SQLException, DatabaseException; | |
32 | ||
33 | SqlStatement getStatement(); | |
34 | } |