- Type Parameters:
T
- the type of object resulting from the packing
public interface ResultPacker<T>
A ResultPacker packs the contents of a ResultSet into a List.
-
Method Summary
Modifier and TypeMethodDescriptionFetches a single instance from the given result set, assumingResultSet.next()
has been calledIterates through the given ResultSet, packing its contents into a List usingget(ResultSet)
in the order they appear.
-
Method Details
-
pack
Iterates through the given ResultSet, packing its contents into a List usingget(ResultSet)
in the order they appear. Items are skipped ifget(ResultSet)
returns null. This method does not close the ResultSet.- Parameters:
resultSet
- the ResultSet instance containing the query result to process- Returns:
- a List containing the data from the query result
- Throws:
SQLException
- thrown if anything goes wrong during the packingNullPointerException
- in case resultSet is null
-
get
Fetches a single instance from the given result set, assumingResultSet.next()
has been called- Parameters:
resultSet
- the result set- Returns:
- the instance fetched from the ResultSet
- Throws:
SQLException
- in case of failure
-