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