The Spring Framework

org.springframework.jdbc.core
Interface RowCallbackHandler

All Known Implementing Classes:
RowCountCallbackHandler

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.

Author:
Rod Johnson
See Also:
ResultSetExtractor, RowCountCallbackHandler, RowMapper

Method Summary
 void processRow(ResultSet rs)
          Implementations must implement this method to process each row of data in the ResultSet.
 

Method Detail

processRow

void processRow(ResultSet rs)
                throws SQLException
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:
rs - the ResultSet to process
Throws:
SQLException - if a SQLException is encountered getting column values (that is, there's no need to catch SQLException)

The Spring Framework

Copyright © 2002-2006 The Spring Framework.