- Type Parameters:
T- the result type
- All Known Implementing Classes:
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
JdbcTemplate's query methods. Implementations of this interface perform the actual work of extracting results from a
ResultSet, but don't need to worry about exception handling.
SQLExceptionswill be caught and handled by the calling JdbcTemplate.
This interface is mainly used within the JDBC framework itself.
RowMapper is usually a simpler choice for ResultSet processing,
mapping one result object per row instead of one result object for
the entire ResultSet.
Note: In contrast to a
RowCallbackHandler, a ResultSetExtractor
object is typically stateless and thus reusable, as long as it doesn't
access stateful resources (such as output streams when streaming LOB
contents) or keep result state within the object.
extractDataImplementations must implement this method to process the entire ResultSet.
rs- the ResultSet to extract data from. Implementations should not close this: it will be closed by the calling JdbcTemplate.
- an arbitrary result object, or
nullif none (the extractor will typically be stateful in the latter case).
SQLException- if an SQLException is encountered getting column values or navigating (that is, there's no need to catch SQLException)
DataAccessException- in case of custom exceptions