org.springframework.jdbc.core
Interface RowCallbackHandler

public interface RowCallbackHandler
Callback interface used by JdbcTemplate's query methods. Implementations of this interface perform the actual work of extracting results, but don't need to worry about exception handling. SQLExceptions will be caught and handled correctly by the JdbcTemplate class.

In contrast to a ResultSetExtractor, a RowCallbackHandler object is typically stateful: It keeps the result state within the object, to be available for later inspection. See RowCountCallbackHandler's javadoc for a usage example with JdbcTemplate.

The ResultReader subinterface allows to make a results list available in a uniform manner. JdbcTemplate's query methods will return the results list in that case, else returning null (-> result state is solely available from RowCallbackHandler object).

A convenient out-of-the-box implementation of RowCallbackHandler is the RowMapperResultReader adapter which delegates row mapping to a RowMapper. Note that a RowMapper object is typically stateless and thus reusable; just the RowMapperResultReader adapter is stateful.

SinceNot specified.
VersionNot specified.
AuthorRod Johnson
Wiki javadoc Use textile entry format.
Add your comments here.
Method Summary
void processRow( ResultSet rs )
Implementations must implement this method to process each row of data in the ResultSet.
processRow
public void processRow ( ResultSet rs )
throws
Implementations must implement this method to process each row of data in the ResultSet. This method should not call next() on the ResultSet, but extract the current values. Exactly what the implementation chooses to do is up to it; a trivial implementation might simply count rows, while another implementation might build an XML document.
Parameters
TypeNameDescription
ResultSet rs the ResultSet to process
Returns void No description provided.
Exceptions
SQLException if a SQLException is encountered getting column values (that is, there's no need to catch SQLException)
Wiki javadoc Use textile entry format.
Add your comments here.