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:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of MapHandler using aBasicRowProcessorfor conversion.MapHandler(RowProcessor convert) Creates a new instance of MapHandler. -
Method Summary
-
Constructor Details
-
MapHandler
public MapHandler()Creates a new instance of MapHandler using aBasicRowProcessorfor conversion. -
MapHandler
Creates a new instance of MapHandler.- Parameters:
convert- TheRowProcessorimplementation to use when converting rows into Maps.
-
-
Method Details
-
handle
Converts the first row in theResultSetinto aMap.- Specified by:
handlein interfaceResultSetHandler<Map<String,Object>> - Parameters:
resultSet-ResultSetto process.- Returns:
- A
Mapwith the values from the first row ornullif there are no rows in theResultSet. - Throws:
SQLException- if a database access error occurs- See Also:
-