Class ArrayHandler
- java.lang.Object
-
- org.apache.commons.dbutils.handlers.ArrayHandler
-
- All Implemented Interfaces:
ResultSetHandler<Object[]>
public class ArrayHandler extends Object implements ResultSetHandler<Object[]>
ResultSetHandler
implementation that converts aResultSet
into anObject[]
. This class is thread safe.- See Also:
ResultSetHandler
-
-
Constructor Summary
Constructors Constructor Description ArrayHandler()
Creates a new instance of ArrayHandler using aBasicRowProcessor
for conversion.ArrayHandler(RowProcessor convert)
Creates a new instance of ArrayHandler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object[]
handle(ResultSet resultSet)
Places the column values from the first row in anObject[]
.
-
-
-
Constructor Detail
-
ArrayHandler
public ArrayHandler()
Creates a new instance of ArrayHandler using aBasicRowProcessor
for conversion.
-
ArrayHandler
public ArrayHandler(RowProcessor convert)
Creates a new instance of ArrayHandler.- Parameters:
convert
- TheRowProcessor
implementation to use when converting rows into arrays.
-
-
Method Detail
-
handle
public Object[] handle(ResultSet resultSet) throws SQLException
Places the column values from the first row in anObject[]
.- Specified by:
handle
in interfaceResultSetHandler<Object[]>
- Parameters:
resultSet
-ResultSet
to process.- Returns:
- An Object[]. If there are no rows in the
ResultSet
an empty array will be returned. - Throws:
SQLException
- if a database access error occurs- See Also:
ResultSetHandler.handle(java.sql.ResultSet)
-
-