T - the type of result returned by the handlerpublic interface ResultSetHandler<T>
This interface provides the means for an JdbcQuery query to
process the results of a query in an arbitrary fashion.
While the handleResult(ResultSet) method can return a value, it is
not always necessary. When an implementation does not need to return a
value, simply use Void as the type parameter.
Example:
ResultSetHandler<Void> handler = new ResultSetHandler<>() {
public Void handleResult(ResultSet rs) throws SQLException {
while (rs.next()) {
exporter.exportPerson(rs.getLong("id"), rs.getString("name"));
}
return null;
}
};
| Modifier and Type | Method and Description |
|---|---|
T |
handleResult(ResultSet rs)
Handles the result set returned by a query.
|
T handleResult(ResultSet rs) throws SQLException
rs - the result set to processTSQLException - as neededCopyright © 2014–2015 Carl Harris, Jr. All rights reserved.