Package org.apache.commons.dbutils
Interface RowProcessor
- All Known Implementing Classes:
BasicRowProcessor
public interface RowProcessor
RowProcessor implementations convert
ResultSet rows into various other objects. Implementations
can extend BasicRowProcessor to protect themselves
from changes to this interface.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionObject[]Create anObject[]from the column values in oneResultSetrow.<T> TCreate a JavaBean from the column values in oneResultSetrow.<T> List<T>toBeanList(ResultSet resultSet, Class<? extends T> type) Create aListof JavaBeans from the column values in allResultSetrows.Create aMapfrom the column values in oneResultSetrow.
-
Method Details
-
toArray
Create anObject[]from the column values in oneResultSetrow. TheResultSetshould be positioned on a valid row before passing it to this method. Implementations of this method must not alter the row position of theResultSet.- Parameters:
resultSet- ResultSet that supplies the array data- Returns:
- the newly created array
- Throws:
SQLException- if a database access error occurs
-
toBean
Create a JavaBean from the column values in oneResultSetrow. TheResultSetshould be positioned on a valid row before passing it to this method. Implementations of this method must not alter the row position of theResultSet.- Type Parameters:
T- The type of bean to create- Parameters:
resultSet- ResultSet that supplies the bean datatype- Class from which to create the bean instance- Returns:
- the newly created bean
- Throws:
SQLException- if a database access error occurs
-
toBeanList
Create aListof JavaBeans from the column values in allResultSetrows.ResultSet.next()should not be called before passing it to this method.- Type Parameters:
T- The type of bean to create- Parameters:
resultSet- ResultSet that supplies the bean datatype- Class from which to create the bean instance- Returns:
- A
Listof beans with the given type in the order they were returned by theResultSet. - Throws:
SQLException- if a database access error occurs
-
toMap
Create aMapfrom the column values in oneResultSetrow. TheResultSetshould be positioned on a valid row before passing it to this method. Implementations of this method must not alter the row position of theResultSet.- Parameters:
resultSet- ResultSet that supplies the map data- Returns:
- the newly created Map
- Throws:
SQLException- if a database access error occurs
-