程序包 weka.gui.sql

类 ResultSetHelper

java.lang.Object
weka.gui.sql.ResultSetHelper

public class ResultSetHelper extends Object
Represents an extended JTable, containing a table model based on a ResultSet and the corresponding query.
版本:
$Revision: 7043 $
作者:
FracPete (fracpete at waikato dot ac dot nz)
  • 构造器概要

    构造器
    构造器
    说明
    initializes the helper, with unlimited number of rows.
    ResultSetHelper(ResultSet rs, int max)
    initializes the helper, with the given maximum number of rows (less than 1 means unlimited).
  • 方法概要

    修饰符和类型
    方法
    说明
    Object[][]
    returns an 2-dimensional array with the content of the resultset, the first dimension is the row, the second the column (i.e., getCells()[y][x]).
    returns the classes for the columns.
    int
    returns the number of columns in the resultset.
    returns an array with the names of the columns in the resultset.
    int
    the maximum number of rows to retrieve, less than 1 means unlimited.
    boolean[]
    returns an array that indicates whether a column is numeric or nor.
    the underlying resultset.
    int
    returns the number of rows in the resultset.
    boolean
    whether a limit on the rows to retrieve was set.
    static boolean
    typeIsNumeric(int type)
    returns whether the SQL type is numeric (and therefore the justification should be right).
    static Class
    typeToClass(int type)
    Returns the class associated with a SQL type.

    从类继承的方法 java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • ResultSetHelper

      public ResultSetHelper(ResultSet rs)
      initializes the helper, with unlimited number of rows.
      参数:
      rs - the resultset to work on
    • ResultSetHelper

      public ResultSetHelper(ResultSet rs, int max)
      initializes the helper, with the given maximum number of rows (less than 1 means unlimited).
      参数:
      rs - the resultset to work on
      max - the maximum number of rows to retrieve
  • 方法详细资料

    • getResultSet

      public ResultSet getResultSet()
      the underlying resultset.
      返回:
      the resultset
    • getColumnCount

      public int getColumnCount()
      returns the number of columns in the resultset.
      返回:
      the number of columns
    • getRowCount

      public int getRowCount()
      returns the number of rows in the resultset. If -1 then the number of rows couldn't be determined, i.e., the cursors aren't scrollable.
      返回:
      the number of rows, -1 if it wasn't possible to determine
    • getColumnNames

      public String[] getColumnNames()
      returns an array with the names of the columns in the resultset.
      返回:
      the column names
    • getNumericColumns

      public boolean[] getNumericColumns()
      returns an array that indicates whether a column is numeric or nor.
      返回:
      the numeric columns
    • getColumnClasses

      public Class[] getColumnClasses()
      returns the classes for the columns.
      返回:
      the column classes
    • hasMaxRows

      public boolean hasMaxRows()
      whether a limit on the rows to retrieve was set.
      返回:
      true if there's a limit
    • getMaxRows

      public int getMaxRows()
      the maximum number of rows to retrieve, less than 1 means unlimited.
      返回:
      the maximum number of rows
    • getCells

      public Object[][] getCells()
      returns an 2-dimensional array with the content of the resultset, the first dimension is the row, the second the column (i.e., getCells()[y][x]). Note: the data is not cached! It is always retrieved anew.
      返回:
      the data
    • typeToClass

      public static Class typeToClass(int type)
      Returns the class associated with a SQL type.
      参数:
      type - the SQL type
      返回:
      the Java class corresponding with the type
    • typeIsNumeric

      public static boolean typeIsNumeric(int type)
      returns whether the SQL type is numeric (and therefore the justification should be right).
      参数:
      type - the SQL type
      返回:
      whether the given type is numeric