org.springframework.jdbc.core
Class JdbcTemplate.RowCallbackHandlerResultSetExtractor
java.lang.Object
org.springframework.jdbc.core.JdbcTemplate.RowCallbackHandlerResultSetExtractor
- All Implemented Interfaces:
- ResultSetExtractor<java.lang.Object>
- Enclosing class:
- JdbcTemplate
private static class JdbcTemplate.RowCallbackHandlerResultSetExtractor
- extends java.lang.Object
- implements ResultSetExtractor<java.lang.Object>
Adapter to enable use of a RowCallbackHandler inside a ResultSetExtractor.
Uses a regular ResultSet, so we have to be careful when using it:
We don't use it for navigating since this could lead to unpredictable consequences.
Method Summary |
java.lang.Object |
extractData(java.sql.ResultSet rs)
Implementations must implement this method to process the entire ResultSet. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
rch
private final RowCallbackHandler rch
JdbcTemplate.RowCallbackHandlerResultSetExtractor
public JdbcTemplate.RowCallbackHandlerResultSetExtractor(RowCallbackHandler rch)
extractData
public java.lang.Object extractData(java.sql.ResultSet rs)
throws java.sql.SQLException
- Description copied from interface:
ResultSetExtractor
- Implementations must implement this method to process the entire ResultSet.
- Specified by:
extractData
in interface ResultSetExtractor<java.lang.Object>
- Parameters:
rs
- ResultSet to extract data from. Implementations should
not close this: it will be closed by the calling JdbcTemplate.
- Returns:
- an arbitrary result object, or
null
if none
(the extractor will typically be stateful in the latter case).
- Throws:
java.sql.SQLException
- if a SQLException is encountered getting column
values or navigating (that is, there's no need to catch SQLException)