public interface RowProcessor
RowProcessor
implementations convert
ResultSet
rows into various other objects. Implementations
can extend BasicRowProcessor
to protect themselves
from changes to this interface.BasicRowProcessor
Modifier and Type | Method and Description |
---|---|
Object[] |
toArray(ResultSet resultSet)
Create an
Object[] from the column values in one
ResultSet row. |
<T> T |
toBean(ResultSet resultSet,
Class<? extends T> type)
Create a JavaBean from the column values in one
ResultSet
row. |
<T> List<T> |
toBeanList(ResultSet resultSet,
Class<? extends T> type)
Create a
List of JavaBeans from the column values in all
ResultSet rows. |
Map<String,Object> |
toMap(ResultSet resultSet)
Create a
Map from the column values in one
ResultSet row. |
Object[] toArray(ResultSet resultSet) throws SQLException
Object[]
from the column values in one
ResultSet
row. The ResultSet
should be
positioned on a valid row before passing it to this method.
Implementations of this method must not alter the row position of
the ResultSet
.resultSet
- ResultSet that supplies the array dataSQLException
- if a database access error occurs<T> T toBean(ResultSet resultSet, Class<? extends T> type) throws SQLException
ResultSet
row. The ResultSet
should be positioned on a valid row before
passing it to this method. Implementations of this method must not
alter the row position of the ResultSet
.T
- The type of bean to createresultSet
- ResultSet that supplies the bean datatype
- Class from which to create the bean instanceSQLException
- if a database access error occurs<T> List<T> toBeanList(ResultSet resultSet, Class<? extends T> type) throws SQLException
List
of JavaBeans from the column values in all
ResultSet
rows. ResultSet.next()
should
not be called before passing it to this method.T
- The type of bean to createresultSet
- ResultSet that supplies the bean datatype
- Class from which to create the bean instanceList
of beans with the given type in the order
they were returned by the ResultSet
.SQLException
- if a database access error occursMap<String,Object> toMap(ResultSet resultSet) throws SQLException
Map
from the column values in one
ResultSet
row. The ResultSet
should be
positioned on a valid row before
passing it to this method. Implementations of this method must not
alter the row position of the ResultSet
.resultSet
- ResultSet that supplies the map dataSQLException
- if a database access error occursCopyright © 2002–2023 The Apache Software Foundation. All rights reserved.