public interface SqlRowSet
extends java.io.Serializable
RowSet
, representing a disconnected variant of
ResultSet
data.
The main difference to the standard JDBC RowSet is that a SQLException
is never thrown here. This allows a SqlRowSet to be used without having to deal with
checked exceptions. A SqlRowSet will throw Spring's InvalidResultSetAccessException
instead (when appropriate).
Note: This interface extends the java.io.Serializable
marker interface.
Implementations, which typically hold disconnected data, are encouraged to be actually
serializable (as far as possible).
RowSet
,
ResultSet
,
InvalidResultSetAccessException
,
JdbcTemplate.queryForRowSet(java.lang.String)
Modifier and Type | Method and Description |
---|---|
boolean |
absolute(int row)
Move the cursor to the given row number in the row set, just after the last row.
|
void |
afterLast()
Move the cursor to the end of this row set.
|
void |
beforeFirst()
Move the cursor to the front of this row set, just before the first row.
|
int |
findColumn(java.lang.String columnLabel)
Map the given column label to its column index.
|
boolean |
first()
Move the cursor to the first row of this row set.
|
java.math.BigDecimal |
getBigDecimal(int columnIndex)
Retrieve the value of the indicated column in the current row as a BigDecimal object.
|
java.math.BigDecimal |
getBigDecimal(java.lang.String columnLabel)
Retrieve the value of the indicated column in the current row as a BigDecimal object.
|
boolean |
getBoolean(int columnIndex)
Retrieve the value of the indicated column in the current row as a boolean.
|
boolean |
getBoolean(java.lang.String columnLabel)
Retrieve the value of the indicated column in the current row as a boolean.
|
byte |
getByte(int columnIndex)
Retrieve the value of the indicated column in the current row as a byte.
|
byte |
getByte(java.lang.String columnLabel)
Retrieve the value of the indicated column in the current row as a byte.
|
java.sql.Date |
getDate(int columnIndex)
Retrieve the value of the indicated column in the current row as a Date object.
|
java.sql.Date |
getDate(int columnIndex,
java.util.Calendar cal)
Retrieve the value of the indicated column in the current row as a Date object.
|
java.sql.Date |
getDate(java.lang.String columnLabel)
Retrieve the value of the indicated column in the current row as a Date object.
|
java.sql.Date |
getDate(java.lang.String columnLabel,
java.util.Calendar cal)
Retrieve the value of the indicated column in the current row as a Date object.
|
double |
getDouble(int columnIndex)
Retrieve the value of the indicated column in the current row as a Double object.
|
double |
getDouble(java.lang.String columnLabel)
Retrieve the value of the indicated column in the current row as a Double object.
|
float |
getFloat(int columnIndex)
Retrieve the value of the indicated column in the current row as a float.
|
float |
getFloat(java.lang.String columnLabel)
Retrieve the value of the indicated column in the current row as a float.
|
int |
getInt(int columnIndex)
Retrieve the value of the indicated column in the current row as an int.
|
int |
getInt(java.lang.String columnLabel)
Retrieve the value of the indicated column in the current row as an int.
|
long |
getLong(int columnIndex)
Retrieve the value of the indicated column in the current row as a long.
|
long |
getLong(java.lang.String columnLabel)
Retrieve the value of the indicated column in the current row as a long.
|
SqlRowSetMetaData |
getMetaData()
Retrieve the meta-data, i.e.
|
java.lang.String |
getNString(int columnIndex)
Retrieve the value of the indicated column in the current row as a String
(for NCHAR, NVARCHAR, LONGNVARCHAR columns).
|
java.lang.String |
getNString(java.lang.String columnLabel)
Retrieve the value of the indicated column in the current row as a String
(for NCHAR, NVARCHAR, LONGNVARCHAR columns).
|
java.lang.Object |
getObject(int columnIndex)
Retrieve the value of the indicated column in the current row as an Object.
|
<T> T |
getObject(int columnIndex,
java.lang.Class<T> type)
Retrieve the value of the indicated column in the current row as an Object.
|
java.lang.Object |
getObject(int columnIndex,
java.util.Map<java.lang.String,java.lang.Class<?>> map)
Retrieve the value of the indicated column in the current row as an Object.
|
java.lang.Object |
getObject(java.lang.String columnLabel)
Retrieve the value of the indicated column in the current row as an Object.
|
<T> T |
getObject(java.lang.String columnLabel,
java.lang.Class<T> type)
Retrieve the value of the indicated column in the current row as an Object.
|
java.lang.Object |
getObject(java.lang.String columnLabel,
java.util.Map<java.lang.String,java.lang.Class<?>> map)
Retrieve the value of the indicated column in the current row as an Object.
|
int |
getRow()
Retrieve the current row number.
|
short |
getShort(int columnIndex)
Retrieve the value of the indicated column in the current row as a short.
|
short |
getShort(java.lang.String columnLabel)
Retrieve the value of the indicated column in the current row as a short.
|
java.lang.String |
getString(int columnIndex)
Retrieve the value of the indicated column in the current row as a String.
|
java.lang.String |
getString(java.lang.String columnLabel)
Retrieve the value of the indicated column in the current row as a String.
|
java.sql.Time |
getTime(int columnIndex)
Retrieve the value of the indicated column in the current row as a Time object.
|
java.sql.Time |
getTime(int columnIndex,
java.util.Calendar cal)
Retrieve the value of the indicated column in the current row as a Time object.
|
java.sql.Time |
getTime(java.lang.String columnLabel)
Retrieve the value of the indicated column in the current row as a Time object.
|
java.sql.Time |
getTime(java.lang.String columnLabel,
java.util.Calendar cal)
Retrieve the value of the indicated column in the current row as a Time object.
|
java.sql.Timestamp |
getTimestamp(int columnIndex)
Retrieve the value of the indicated column in the current row as a Timestamp object.
|
java.sql.Timestamp |
getTimestamp(int columnIndex,
java.util.Calendar cal)
Retrieve the value of the indicated column in the current row as a Timestamp object.
|
java.sql.Timestamp |
getTimestamp(java.lang.String columnLabel)
Retrieve the value of the indicated column in the current row as a Timestamp object.
|
java.sql.Timestamp |
getTimestamp(java.lang.String columnLabel,
java.util.Calendar cal)
Retrieve the value of the indicated column in the current row as a Timestamp object.
|
boolean |
isAfterLast()
Retrieve whether the cursor is after the last row of this row set.
|
boolean |
isBeforeFirst()
Retrieve whether the cursor is before the first row of this row set.
|
boolean |
isFirst()
Retrieve whether the cursor is on the first row of this row set.
|
boolean |
isLast()
Retrieve whether the cursor is on the last row of this row set.
|
boolean |
last()
Move the cursor to the last row of this row set.
|
boolean |
next()
Move the cursor to the next row.
|
boolean |
previous()
Move the cursor to the previous row.
|
boolean |
relative(int rows)
Move the cursor a relative number of rows, either positive or negative.
|
boolean |
wasNull()
Report whether the last column read had a value of SQL
NULL . |
SqlRowSetMetaData getMetaData()
ResultSet.getMetaData()
int findColumn(java.lang.String columnLabel) throws InvalidResultSetAccessException
columnLabel
- the name of the columnInvalidResultSetAccessException
ResultSet.findColumn(String)
java.math.BigDecimal getBigDecimal(int columnIndex) throws InvalidResultSetAccessException
columnIndex
- the column indexInvalidResultSetAccessException
ResultSet.getBigDecimal(int)
java.math.BigDecimal getBigDecimal(java.lang.String columnLabel) throws InvalidResultSetAccessException
columnLabel
- the column labelInvalidResultSetAccessException
ResultSet.getBigDecimal(String)
boolean getBoolean(int columnIndex) throws InvalidResultSetAccessException
columnIndex
- the column indexInvalidResultSetAccessException
ResultSet.getBoolean(int)
boolean getBoolean(java.lang.String columnLabel) throws InvalidResultSetAccessException
columnLabel
- the column labelInvalidResultSetAccessException
ResultSet.getBoolean(String)
byte getByte(int columnIndex) throws InvalidResultSetAccessException
columnIndex
- the column indexInvalidResultSetAccessException
ResultSet.getByte(int)
byte getByte(java.lang.String columnLabel) throws InvalidResultSetAccessException
columnLabel
- the column labelInvalidResultSetAccessException
ResultSet.getByte(String)
java.sql.Date getDate(int columnIndex) throws InvalidResultSetAccessException
columnIndex
- the column indexInvalidResultSetAccessException
ResultSet.getDate(int)
java.sql.Date getDate(java.lang.String columnLabel) throws InvalidResultSetAccessException
columnLabel
- the column labelInvalidResultSetAccessException
ResultSet.getDate(String)
java.sql.Date getDate(int columnIndex, java.util.Calendar cal) throws InvalidResultSetAccessException
columnIndex
- the column indexcal
- the Calendar to use in constructing the DateInvalidResultSetAccessException
ResultSet.getDate(int, Calendar)
java.sql.Date getDate(java.lang.String columnLabel, java.util.Calendar cal) throws InvalidResultSetAccessException
columnLabel
- the column labelcal
- the Calendar to use in constructing the DateInvalidResultSetAccessException
ResultSet.getDate(String, Calendar)
double getDouble(int columnIndex) throws InvalidResultSetAccessException
columnIndex
- the column indexInvalidResultSetAccessException
ResultSet.getDouble(int)
double getDouble(java.lang.String columnLabel) throws InvalidResultSetAccessException
columnLabel
- the column labelInvalidResultSetAccessException
ResultSet.getDouble(String)
float getFloat(int columnIndex) throws InvalidResultSetAccessException
columnIndex
- the column indexInvalidResultSetAccessException
ResultSet.getFloat(int)
float getFloat(java.lang.String columnLabel) throws InvalidResultSetAccessException
columnLabel
- the column labelInvalidResultSetAccessException
ResultSet.getFloat(String)
int getInt(int columnIndex) throws InvalidResultSetAccessException
columnIndex
- the column indexInvalidResultSetAccessException
ResultSet.getInt(int)
int getInt(java.lang.String columnLabel) throws InvalidResultSetAccessException
columnLabel
- the column labelInvalidResultSetAccessException
ResultSet.getInt(String)
long getLong(int columnIndex) throws InvalidResultSetAccessException
columnIndex
- the column indexInvalidResultSetAccessException
ResultSet.getLong(int)
long getLong(java.lang.String columnLabel) throws InvalidResultSetAccessException
columnLabel
- the column labelInvalidResultSetAccessException
ResultSet.getLong(String)
java.lang.String getNString(int columnIndex) throws InvalidResultSetAccessException
columnIndex
- the column indexInvalidResultSetAccessException
ResultSet.getNString(int)
java.lang.String getNString(java.lang.String columnLabel) throws InvalidResultSetAccessException
columnLabel
- the column labelInvalidResultSetAccessException
ResultSet.getNString(String)
java.lang.Object getObject(int columnIndex) throws InvalidResultSetAccessException
columnIndex
- the column indexInvalidResultSetAccessException
ResultSet.getObject(int)
java.lang.Object getObject(java.lang.String columnLabel) throws InvalidResultSetAccessException
columnLabel
- the column labelInvalidResultSetAccessException
ResultSet.getObject(String)
java.lang.Object getObject(int columnIndex, java.util.Map<java.lang.String,java.lang.Class<?>> map) throws InvalidResultSetAccessException
columnIndex
- the column indexmap
- a Map object containing the mapping from SQL types to Java typesInvalidResultSetAccessException
ResultSet.getObject(int, Map)
java.lang.Object getObject(java.lang.String columnLabel, java.util.Map<java.lang.String,java.lang.Class<?>> map) throws InvalidResultSetAccessException
columnLabel
- the column labelmap
- a Map object containing the mapping from SQL types to Java typesInvalidResultSetAccessException
ResultSet.getObject(String, Map)
<T> T getObject(int columnIndex, java.lang.Class<T> type) throws InvalidResultSetAccessException
columnIndex
- the column indextype
- the Java type to convert the designated column toInvalidResultSetAccessException
ResultSet.getObject(int)
<T> T getObject(java.lang.String columnLabel, java.lang.Class<T> type) throws InvalidResultSetAccessException
columnLabel
- the column labeltype
- the Java type to convert the designated column toInvalidResultSetAccessException
ResultSet.getObject(int)
short getShort(int columnIndex) throws InvalidResultSetAccessException
columnIndex
- the column indexInvalidResultSetAccessException
ResultSet.getShort(int)
short getShort(java.lang.String columnLabel) throws InvalidResultSetAccessException
columnLabel
- the column labelInvalidResultSetAccessException
ResultSet.getShort(String)
java.lang.String getString(int columnIndex) throws InvalidResultSetAccessException
columnIndex
- the column indexInvalidResultSetAccessException
ResultSet.getString(int)
java.lang.String getString(java.lang.String columnLabel) throws InvalidResultSetAccessException
columnLabel
- the column labelInvalidResultSetAccessException
ResultSet.getString(String)
java.sql.Time getTime(int columnIndex) throws InvalidResultSetAccessException
columnIndex
- the column indexInvalidResultSetAccessException
ResultSet.getTime(int)
java.sql.Time getTime(java.lang.String columnLabel) throws InvalidResultSetAccessException
columnLabel
- the column labelInvalidResultSetAccessException
ResultSet.getTime(String)
java.sql.Time getTime(int columnIndex, java.util.Calendar cal) throws InvalidResultSetAccessException
columnIndex
- the column indexcal
- the Calendar to use in constructing the DateInvalidResultSetAccessException
ResultSet.getTime(int, Calendar)
java.sql.Time getTime(java.lang.String columnLabel, java.util.Calendar cal) throws InvalidResultSetAccessException
columnLabel
- the column labelcal
- the Calendar to use in constructing the DateInvalidResultSetAccessException
ResultSet.getTime(String, Calendar)
java.sql.Timestamp getTimestamp(int columnIndex) throws InvalidResultSetAccessException
columnIndex
- the column indexInvalidResultSetAccessException
ResultSet.getTimestamp(int)
java.sql.Timestamp getTimestamp(java.lang.String columnLabel) throws InvalidResultSetAccessException
columnLabel
- the column labelInvalidResultSetAccessException
ResultSet.getTimestamp(String)
java.sql.Timestamp getTimestamp(int columnIndex, java.util.Calendar cal) throws InvalidResultSetAccessException
columnIndex
- the column indexcal
- the Calendar to use in constructing the DateInvalidResultSetAccessException
ResultSet.getTimestamp(int, Calendar)
java.sql.Timestamp getTimestamp(java.lang.String columnLabel, java.util.Calendar cal) throws InvalidResultSetAccessException
columnLabel
- the column labelcal
- the Calendar to use in constructing the DateInvalidResultSetAccessException
ResultSet.getTimestamp(String, Calendar)
boolean absolute(int row) throws InvalidResultSetAccessException
row
- the number of the row where the cursor should movetrue
if the cursor is on the row set, false
otherwiseInvalidResultSetAccessException
ResultSet.absolute(int)
void afterLast() throws InvalidResultSetAccessException
InvalidResultSetAccessException
ResultSet.afterLast()
void beforeFirst() throws InvalidResultSetAccessException
InvalidResultSetAccessException
ResultSet.beforeFirst()
boolean first() throws InvalidResultSetAccessException
true
if the cursor is on a valid row, false
otherwiseInvalidResultSetAccessException
ResultSet.first()
int getRow() throws InvalidResultSetAccessException
InvalidResultSetAccessException
ResultSet.getRow()
boolean isAfterLast() throws InvalidResultSetAccessException
true
if the cursor is after the last row, false
otherwiseInvalidResultSetAccessException
ResultSet.isAfterLast()
boolean isBeforeFirst() throws InvalidResultSetAccessException
true
if the cursor is before the first row, false
otherwiseInvalidResultSetAccessException
ResultSet.isBeforeFirst()
boolean isFirst() throws InvalidResultSetAccessException
true
if the cursor is after the first row, false
otherwiseInvalidResultSetAccessException
ResultSet.isFirst()
boolean isLast() throws InvalidResultSetAccessException
true
if the cursor is after the last row, false
otherwiseInvalidResultSetAccessException
ResultSet.isLast()
boolean last() throws InvalidResultSetAccessException
true
if the cursor is on a valid row, false
otherwiseInvalidResultSetAccessException
ResultSet.last()
boolean next() throws InvalidResultSetAccessException
true
if the new row is valid, false
if there are no more rowsInvalidResultSetAccessException
ResultSet.next()
boolean previous() throws InvalidResultSetAccessException
true
if the new row is valid, false
if it is off the row setInvalidResultSetAccessException
ResultSet.previous()
boolean relative(int rows) throws InvalidResultSetAccessException
true
if the cursor is on a row, false
otherwiseInvalidResultSetAccessException
ResultSet.relative(int)
boolean wasNull() throws InvalidResultSetAccessException
NULL
.
Note that you must first call one of the getter methods and then
call the wasNull()
method.
true
if the most recent column retrieved was
SQL NULL
, false
otherwiseInvalidResultSetAccessException
ResultSet.wasNull()