class ResultImpl extends java.lang.Object implements Result, java.io.Serializable
This class creates a cached version of a ResultSet. It's represented as a Result implementation, capable of returing an array of Row objects containing a Column instance for each column in the row. It is not part of the JSTL API; it serves merely as a back-end to ResultSupport's static methods. Thus, we scope its access to the package.
Modifier and Type | Field and Description |
---|---|
private java.lang.String[] |
columnNames |
private boolean |
isLimited |
private java.util.List |
rowByIndex |
private java.util.List |
rowMap |
Constructor and Description |
---|
ResultImpl(java.sql.ResultSet rs,
int startRow,
int maxRows)
This constructor reads the ResultSet and saves a cached
copy.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
getColumnNames()
Returns an array of String objects.
|
int |
getRowCount()
Returns the number of rows in the cached ResultSet
|
java.util.SortedMap[] |
getRows()
Returns an array of SortedMap objects.
|
java.lang.Object[][] |
getRowsByIndex()
Returns an array of Object[] objects.
|
boolean |
isLimitedByMaxRows()
Returns true if the query was limited by a maximum row setting
|
private java.util.List rowMap
private java.util.List rowByIndex
private java.lang.String[] columnNames
private boolean isLimited
public ResultImpl(java.sql.ResultSet rs, int startRow, int maxRows) throws java.sql.SQLException
rs
- an open ResultSet, positioned before the first
rowstartRow
- beginning row to be cachedmaxRows
- query maximum rows limitjava.sql.SQLException
- if a database error occurspublic java.util.SortedMap[] getRows()
public java.lang.Object[][] getRowsByIndex()
getRowsByIndex
in interface Result
public java.lang.String[] getColumnNames()
getColumnNames
in interface Result
public int getRowCount()
getRowCount
in interface Result
public boolean isLimitedByMaxRows()
isLimitedByMaxRows
in interface Result