- Type Parameters:
T
- the type of object resulting from the packing
public interface ResultPacker<T>
-
Method Summary
Modifier and TypeMethodDescriptionFetches a single instance from the givenResultSet
, assumingResultSet.next()
has been calledIterates through the givenResultSet
, packing its contents into aList
usingget(ResultSet)
in the order they appear.
-
Method Details
-
pack
Iterates through the givenResultSet
, packing its contents into aList
usingget(ResultSet)
in the order they appear. This method does not close theResultSet
.- Parameters:
resultSet
- theResultSet
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 caseresultSet
is null
-
get
Fetches a single instance from the givenResultSet
, assumingResultSet.next()
has been called- Parameters:
resultSet
- theResultSet
- Returns:
- the instance fetched from the
ResultSet
- Throws:
SQLException
- in case of failure
-