Reusable query in which concrete subclasses must implement the abstract
mapRow(ResultSet, int) method to convert each row of the JDBC ResultSet
into an object.
Simplifies MappingSqlQueryWithParameters API by dropping parameters and
context. Most subclasses won't care about parameters. If you don't use
contextual information, subclass this instead of MappingSqlQueryWithParameters.
mapRow(ResultSet rs,
int rowNum,
Object[] parameters,
Map context)
This method is implemented to invoke the simpler mapRow
template method, ignoring parameters.
Subclasses must implement this method to convert each row of the
ResultSet into an object of the result type.
Subclasses of this class, as opposed to direct subclasses of
MappingSqlQueryWithParameters, don't need to concern themselves
with the parameters to the execute method of the query object.
Parameters:
rs - ResultSet we're working through
rowNum - row number (from 0) we're up to
Returns:
an object of the result type
Throws:
SQLException - if there's an error extracting data.
Subclasses can simply not catch SQLExceptions, relying on the
framework to clean up.