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 Details

    • IntegerScalarHandler

      public IntegerScalarHandler()
      Creates a new instance of ColumnListHandler. The first column of each row will be returned from handle().
    • IntegerScalarHandler

      public IntegerScalarHandler(int columnIndex)
      Creates a new instance of ColumnListHandler.
      Parameters:
      columnIndex - The index of the column to retrieve from the ResultSet.
    • IntegerScalarHandler

      public IntegerScalarHandler(String columnName)
      Creates a new instance of ColumnListHandler.
      Parameters:
      columnName - The name of the column to retrieve from the ResultSet.
  • Method Details

    • handle

      public Integer handle(ResultSet rs) throws SQLException
      Returns one ResultSet column as an object via the ResultSet.getObject() method that performs type conversions.
      Specified by:
      handle in interface org.apache.commons.dbutils.ResultSetHandler<Integer>
      Overrides:
      handle in class org.apache.commons.dbutils.handlers.ScalarHandler<Integer>
      Parameters:
      rs - ResultSet to process.
      Returns:
      The column or null if there are no rows in the ResultSet.
      Throws:
      SQLException - if a database access error occurs
      ClassCastException - if the class datatype does not match the column type
      See Also:
      • ResultSetHandler.handle(java.sql.ResultSet)