Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
ResultSetExtractor |
|
| 1.0;1 |
1 | package liquibase.executor.jvm; | |
2 | ||
3 | import java.sql.ResultSet; | |
4 | import java.sql.SQLException; | |
5 | ||
6 | /** | |
7 | * Callback interface used by {@link liquibase.executor.Executor}'s query methods. Implementations of this interface | |
8 | * perform the actual work of extracting results from a {@link java.sql.ResultSet}, but don't need to worry about | |
9 | * exception handling. {@link java.sql.SQLException SQLExceptions} will be caught and handled by the calling | |
10 | * JdbcTemplate. | |
11 | * <p/> | |
12 | * | |
13 | * @author Spring Framework | |
14 | * @see liquibase.executor.Executor | |
15 | * @see RowCallbackHandler | |
16 | * @see RowMapper | |
17 | */ | |
18 | interface ResultSetExtractor { | |
19 | ||
20 | /** | |
21 | * Implementations must implement this method to process the entire ResultSet. | |
22 | * | |
23 | * @param rs | |
24 | * ResultSet to extract data from. Implementations should not close this: it will be closed by the | |
25 | * calling JdbcTemplate. | |
26 | * @return an arbitrary result object, or <code>null</code> if none (the extractor will typically be stateful in the | |
27 | * latter case). | |
28 | * @throws java.sql.SQLException | |
29 | * if a SQLException is encountered getting column values or navigating (that is, there's no need to | |
30 | * catch SQLException) | |
31 | * @throws liquibase.exception.DatabaseException | |
32 | * in case of custom exceptions | |
33 | */ | |
34 | Object extractData(ResultSet rs) throws SQLException; | |
35 | ||
36 | } |