JdbcTemplate and
NamedParameterJdbcTemplate for processing rows of a
java.sql.ResultSet on a per-row basis. Implementations of
this interface perform the actual work of processing each row
but don't need to worry about exception handling.
SQLExceptions will be caught and handled
by the calling JdbcTemplate or NamedParameterJdbcTemplate.
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 for a usage example.
Consider using a RowMapper instead if you need to map
exactly one result object per row, assembling them into a List.
JdbcTemplate, NamedParameterJdbcTemplate, RowMapper, ResultSetExtractor, RowCountCallbackHandler
| Modifier and Type | Method and Description |
|---|---|
| public void | processRow(ResultSet
the rs)ResultSet to process (pre-initialized for the current row)Implementations must implement this method to process each row of data
in the |
| processRow | back to summary |
|---|---|
| public void processRow(ResultSet rs) throws SQLException Implementations must implement this method to process each row of data
in the 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.
| |