Package org.knowm.yank.handlers
Class IntegerScalarHandler
java.lang.Object
org.apache.commons.dbutils.handlers.ScalarHandler<Integer>
org.knowm.yank.handlers.IntegerScalarHandler
- All Implemented Interfaces:
org.apache.commons.dbutils.ResultSetHandler<Integer>
public class IntegerScalarHandler
extends org.apache.commons.dbutils.handlers.ScalarHandler<Integer>
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of ColumnListHandler.IntegerScalarHandler(int columnIndex) Creates a new instance of ColumnListHandler.IntegerScalarHandler(String columnName) Creates a new instance of ColumnListHandler. -
Method Summary
-
Constructor Details
-
IntegerScalarHandler
public IntegerScalarHandler()Creates a new instance of ColumnListHandler. The first column of each row will be returned fromhandle(). -
IntegerScalarHandler
public IntegerScalarHandler(int columnIndex) Creates a new instance of ColumnListHandler.- Parameters:
columnIndex- The index of the column to retrieve from theResultSet.
-
IntegerScalarHandler
Creates a new instance of ColumnListHandler.- Parameters:
columnName- The name of the column to retrieve from theResultSet.
-
-
Method Details
-
handle
Returns oneResultSetcolumn as an object via theResultSet.getObject()method that performs type conversions.- Specified by:
handlein interfaceorg.apache.commons.dbutils.ResultSetHandler<Integer>- Overrides:
handlein classorg.apache.commons.dbutils.handlers.ScalarHandler<Integer>- Parameters:
rs-ResultSetto process.- Returns:
- The column or
nullif there are no rows in theResultSet. - Throws:
SQLException- if a database access error occursClassCastException- if the class datatype does not match the column type- See Also:
-
ResultSetHandler.handle(java.sql.ResultSet)
-