01: package liquibase.database.template;
02:
03: import java.sql.ResultSet;
04: import java.sql.SQLException;
05:
06: /**
07: * An interface used by {@link JdbcTemplate} for mapping rows of a
08: * {@link java.sql.ResultSet} on a per-row basis. Implementations of this
09: * interface perform the actual work of mapping each row to a result object,
10: * but don't need to worry about exception handling.
11: * {@link java.sql.SQLException SQLExceptions} will be caught and handled
12: * by the calling JdbcTemplate.
13: * <p/>
14: *
15: * @author Spring Framework
16: * @see JdbcTemplate
17: * @see RowCallbackHandler
18: * @see ResultSetExtractor
19: */
20: interface RowMapper {
21:
22: /**
23: * Implementations must implement this method to map each row of data
24: * in the ResultSet. This method should not call <code>next()</code> on
25: * the ResultSet; it is only supposed to map values of the current row.
26: *
27: * @param rs the ResultSet to map (pre-initialized for the current row)
28: * @param rowNum the number of the current row
29: * @return the result object for the current row
30: * @throws java.sql.SQLException if a SQLException is encountered getting
31: * column values (that is, there's no need to catch SQLException)
32: */
33: Object mapRow(ResultSet rs, int rowNum) throws SQLException;
34:
35: }
|