Class MapHandler
java.lang.Object
org.apache.commons.dbutils.handlers.MapHandler
- All Implemented Interfaces:
ResultSetHandler<Map<String,
Object>>
ResultSetHandler
implementation that converts the first
ResultSet
row into a Map
. This class is thread
safe.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RowProcessor
The RowProcessor implementation to use when converting rows into Maps. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of MapHandler using aBasicRowProcessor
for conversion.MapHandler
(RowProcessor convert) Creates a new instance of MapHandler. -
Method Summary
-
Field Details
-
convert
The RowProcessor implementation to use when converting rows into Maps.
-
-
Constructor Details
-
MapHandler
public MapHandler()Creates a new instance of MapHandler using aBasicRowProcessor
for conversion. -
MapHandler
Creates a new instance of MapHandler.- Parameters:
convert
- TheRowProcessor
implementation to use when converting rows into Maps.
-
-
Method Details
-
handle
Converts the first row in theResultSet
into aMap
.- Specified by:
handle
in interfaceResultSetHandler<Map<String,
Object>> - Parameters:
rs
-ResultSet
to process.- Returns:
- A
Map
with the values from the first row ornull
if there are no rows in theResultSet
. - Throws:
SQLException
- if a database access error occurs- See Also:
-