public class ResultSetHelper
extends java.lang.Object
Constructor and Description |
---|
ResultSetHelper(java.sql.ResultSet rs)
initializes the helper, with unlimited number of rows.
|
ResultSetHelper(java.sql.ResultSet rs,
int max)
initializes the helper, with the given maximum number of rows (less than
1 means unlimited).
|
Modifier and Type | Method and Description |
---|---|
java.lang.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]).
|
java.lang.Class[] |
getColumnClasses()
returns the classes for the columns.
|
int |
getColumnCount()
returns the number of columns in the resultset.
|
java.lang.String[] |
getColumnNames()
returns an array with the names of the columns in the resultset.
|
int |
getMaxRows()
the maximum number of rows to retrieve, less than 1 means unlimited.
|
boolean[] |
getNumericColumns()
returns an array that indicates whether a column is numeric or nor.
|
java.sql.ResultSet |
getResultSet()
the underlying resultset.
|
int |
getRowCount()
returns the number of rows in the resultset.
|
boolean |
hasMaxRows()
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 java.lang.Class |
typeToClass(int type)
Returns the class associated with a SQL type.
|
public ResultSetHelper(java.sql.ResultSet rs)
rs
- the resultset to work onpublic ResultSetHelper(java.sql.ResultSet rs, int max)
rs
- the resultset to work onmax
- the maximum number of rows to retrievepublic java.sql.ResultSet getResultSet()
public int getColumnCount()
public int getRowCount()
public java.lang.String[] getColumnNames()
public boolean[] getNumericColumns()
public java.lang.Class[] getColumnClasses()
public boolean hasMaxRows()
public int getMaxRows()
public java.lang.Object[][] getCells()
public static java.lang.Class typeToClass(int type)
type
- the SQL typepublic static boolean typeIsNumeric(int type)
type
- the SQL type