public interface SqlRowSet extends 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(String columnLabel)
Map the given column label to its column index.
|
boolean |
first()
Move the cursor to the first row of this row set.
|
BigDecimal |
getBigDecimal(int columnIndex)
Retrieve the value of the indicated column in the current row as a BigDecimal object.
|
BigDecimal |
getBigDecimal(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(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(String columnLabel)
Retrieve the value of the indicated column in the current row as a byte.
|
Date |
getDate(int columnIndex)
Retrieve the value of the indicated column in the current row as a Date object.
|
Date |
getDate(int columnIndex,
Calendar cal)
Retrieve the value of the indicated column in the current row as a Date object.
|
Date |
getDate(String columnLabel)
Retrieve the value of the indicated column in the current row as a Date object.
|
Date |
getDate(String columnLabel,
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(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(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(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(String columnLabel)
Retrieve the value of the indicated column in the current row as a long.
|
SqlRowSetMetaData |
getMetaData()
Retrieve the meta-data, i.e.
|
String |
getNString(int columnIndex)
Retrieve the value of the indicated column in the current row as a String
(for NCHAR, NVARCHAR, LONGNVARCHAR columns).
|
String |
getNString(String columnLabel)
Retrieve the value of the indicated column in the current row as a String
(for NCHAR, NVARCHAR, LONGNVARCHAR columns).
|
Object |
getObject(int columnIndex)
Retrieve the value of the indicated column in the current row as an Object.
|
<T> T |
getObject(int columnIndex,
Class<T> type)
Retrieve the value of the indicated column in the current row as an Object.
|
Object |
getObject(int columnIndex,
Map<String,Class<?>> map)
Retrieve the value of the indicated column in the current row as an Object.
|
Object |
getObject(String columnLabel)
Retrieve the value of the indicated column in the current row as an Object.
|
<T> T |
getObject(String columnLabel,
Class<T> type)
Retrieve the value of the indicated column in the current row as an Object.
|
Object |
getObject(String columnLabel,
Map<String,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(String columnLabel)
Retrieve the value of the indicated column in the current row as a short.
|
String |
getString(int columnIndex)
Retrieve the value of the indicated column in the current row as a String.
|
String |
getString(String columnLabel)
Retrieve the value of the indicated column in the current row as a String.
|
Time |
getTime(int columnIndex)
Retrieve the value of the indicated column in the current row as a Time object.
|
Time |
getTime(int columnIndex,
Calendar cal)
Retrieve the value of the indicated column in the current row as a Time object.
|
Time |
getTime(String columnLabel)
Retrieve the value of the indicated column in the current row as a Time object.
|
Time |
getTime(String columnLabel,
Calendar cal)
Retrieve the value of the indicated column in the current row as a Time object.
|
Timestamp |
getTimestamp(int columnIndex)
Retrieve the value of the indicated column in the current row as a Timestamp object.
|
Timestamp |
getTimestamp(int columnIndex,
Calendar cal)
Retrieve the value of the indicated column in the current row as a Timestamp object.
|
Timestamp |
getTimestamp(String columnLabel)
Retrieve the value of the indicated column in the current row as a Timestamp object.
|
Timestamp |
getTimestamp(String columnLabel,
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(String columnLabel) throws InvalidResultSetAccessException
columnLabel - the name of the columnInvalidResultSetAccessExceptionResultSet.findColumn(String)BigDecimal getBigDecimal(int columnIndex) throws InvalidResultSetAccessException
columnIndex - the column indexInvalidResultSetAccessExceptionResultSet.getBigDecimal(int)BigDecimal getBigDecimal(String columnLabel) throws InvalidResultSetAccessException
columnLabel - the column labelInvalidResultSetAccessExceptionResultSet.getBigDecimal(String)boolean getBoolean(int columnIndex)
throws InvalidResultSetAccessException
columnIndex - the column indexInvalidResultSetAccessExceptionResultSet.getBoolean(int)boolean getBoolean(String columnLabel) throws InvalidResultSetAccessException
columnLabel - the column labelInvalidResultSetAccessExceptionResultSet.getBoolean(String)byte getByte(int columnIndex)
throws InvalidResultSetAccessException
columnIndex - the column indexInvalidResultSetAccessExceptionResultSet.getByte(int)byte getByte(String columnLabel) throws InvalidResultSetAccessException
columnLabel - the column labelInvalidResultSetAccessExceptionResultSet.getByte(String)Date getDate(int columnIndex) throws InvalidResultSetAccessException
columnIndex - the column indexInvalidResultSetAccessExceptionResultSet.getDate(int)Date getDate(String columnLabel) throws InvalidResultSetAccessException
columnLabel - the column labelInvalidResultSetAccessExceptionResultSet.getDate(String)Date getDate(int columnIndex, Calendar cal) throws InvalidResultSetAccessException
columnIndex - the column indexcal - the Calendar to use in constructing the DateInvalidResultSetAccessExceptionResultSet.getDate(int, Calendar)Date getDate(String columnLabel, Calendar cal) throws InvalidResultSetAccessException
columnLabel - the column labelcal - the Calendar to use in constructing the DateInvalidResultSetAccessExceptionResultSet.getDate(String, Calendar)double getDouble(int columnIndex)
throws InvalidResultSetAccessException
columnIndex - the column indexInvalidResultSetAccessExceptionResultSet.getDouble(int)double getDouble(String columnLabel) throws InvalidResultSetAccessException
columnLabel - the column labelInvalidResultSetAccessExceptionResultSet.getDouble(String)float getFloat(int columnIndex)
throws InvalidResultSetAccessException
columnIndex - the column indexInvalidResultSetAccessExceptionResultSet.getFloat(int)float getFloat(String columnLabel) throws InvalidResultSetAccessException
columnLabel - the column labelInvalidResultSetAccessExceptionResultSet.getFloat(String)int getInt(int columnIndex)
throws InvalidResultSetAccessException
columnIndex - the column indexInvalidResultSetAccessExceptionResultSet.getInt(int)int getInt(String columnLabel) throws InvalidResultSetAccessException
columnLabel - the column labelInvalidResultSetAccessExceptionResultSet.getInt(String)long getLong(int columnIndex)
throws InvalidResultSetAccessException
columnIndex - the column indexInvalidResultSetAccessExceptionResultSet.getLong(int)long getLong(String columnLabel) throws InvalidResultSetAccessException
columnLabel - the column labelInvalidResultSetAccessExceptionResultSet.getLong(String)String getNString(int columnIndex) throws InvalidResultSetAccessException
columnIndex - the column indexInvalidResultSetAccessExceptionResultSet.getNString(int)String getNString(String columnLabel) throws InvalidResultSetAccessException
columnLabel - the column labelInvalidResultSetAccessExceptionResultSet.getNString(String)Object getObject(int columnIndex) throws InvalidResultSetAccessException
columnIndex - the column indexInvalidResultSetAccessExceptionResultSet.getObject(int)Object getObject(String columnLabel) throws InvalidResultSetAccessException
columnLabel - the column labelInvalidResultSetAccessExceptionResultSet.getObject(String)Object getObject(int columnIndex, Map<String,Class<?>> map) throws InvalidResultSetAccessException
columnIndex - the column indexmap - a Map object containing the mapping from SQL types to Java typesInvalidResultSetAccessExceptionResultSet.getObject(int, Map)Object getObject(String columnLabel, Map<String,Class<?>> map) throws InvalidResultSetAccessException
columnLabel - the column labelmap - a Map object containing the mapping from SQL types to Java typesInvalidResultSetAccessExceptionResultSet.getObject(String, Map)<T> T getObject(int columnIndex,
Class<T> type)
throws InvalidResultSetAccessException
columnIndex - the column indextype - the Java type to convert the designated column toInvalidResultSetAccessExceptionResultSet.getObject(int, Class)<T> T getObject(String columnLabel, Class<T> type) throws InvalidResultSetAccessException
columnLabel - the column labeltype - the Java type to convert the designated column toInvalidResultSetAccessExceptionResultSet.getObject(String, Class)short getShort(int columnIndex)
throws InvalidResultSetAccessException
columnIndex - the column indexInvalidResultSetAccessExceptionResultSet.getShort(int)short getShort(String columnLabel) throws InvalidResultSetAccessException
columnLabel - the column labelInvalidResultSetAccessExceptionResultSet.getShort(String)String getString(int columnIndex) throws InvalidResultSetAccessException
columnIndex - the column indexInvalidResultSetAccessExceptionResultSet.getString(int)String getString(String columnLabel) throws InvalidResultSetAccessException
columnLabel - the column labelInvalidResultSetAccessExceptionResultSet.getString(String)Time getTime(int columnIndex) throws InvalidResultSetAccessException
columnIndex - the column indexInvalidResultSetAccessExceptionResultSet.getTime(int)Time getTime(String columnLabel) throws InvalidResultSetAccessException
columnLabel - the column labelInvalidResultSetAccessExceptionResultSet.getTime(String)Time getTime(int columnIndex, Calendar cal) throws InvalidResultSetAccessException
columnIndex - the column indexcal - the Calendar to use in constructing the DateInvalidResultSetAccessExceptionResultSet.getTime(int, Calendar)Time getTime(String columnLabel, Calendar cal) throws InvalidResultSetAccessException
columnLabel - the column labelcal - the Calendar to use in constructing the DateInvalidResultSetAccessExceptionResultSet.getTime(String, Calendar)Timestamp getTimestamp(int columnIndex) throws InvalidResultSetAccessException
columnIndex - the column indexInvalidResultSetAccessExceptionResultSet.getTimestamp(int)Timestamp getTimestamp(String columnLabel) throws InvalidResultSetAccessException
columnLabel - the column labelInvalidResultSetAccessExceptionResultSet.getTimestamp(String)Timestamp getTimestamp(int columnIndex, Calendar cal) throws InvalidResultSetAccessException
columnIndex - the column indexcal - the Calendar to use in constructing the DateInvalidResultSetAccessExceptionResultSet.getTimestamp(int, Calendar)Timestamp getTimestamp(String columnLabel, Calendar cal) throws InvalidResultSetAccessException
columnLabel - the column labelcal - the Calendar to use in constructing the DateInvalidResultSetAccessExceptionResultSet.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 otherwiseInvalidResultSetAccessExceptionResultSet.absolute(int)void afterLast()
throws InvalidResultSetAccessException
InvalidResultSetAccessExceptionResultSet.afterLast()void beforeFirst()
throws InvalidResultSetAccessException
InvalidResultSetAccessExceptionResultSet.beforeFirst()boolean first()
throws InvalidResultSetAccessException
true if the cursor is on a valid row, false otherwiseInvalidResultSetAccessExceptionResultSet.first()int getRow()
throws InvalidResultSetAccessException
InvalidResultSetAccessExceptionResultSet.getRow()boolean isAfterLast()
throws InvalidResultSetAccessException
true if the cursor is after the last row, false otherwiseInvalidResultSetAccessExceptionResultSet.isAfterLast()boolean isBeforeFirst()
throws InvalidResultSetAccessException
true if the cursor is before the first row, false otherwiseInvalidResultSetAccessExceptionResultSet.isBeforeFirst()boolean isFirst()
throws InvalidResultSetAccessException
true if the cursor is after the first row, false otherwiseInvalidResultSetAccessExceptionResultSet.isFirst()boolean isLast()
throws InvalidResultSetAccessException
true if the cursor is after the last row, false otherwiseInvalidResultSetAccessExceptionResultSet.isLast()boolean last()
throws InvalidResultSetAccessException
true if the cursor is on a valid row, false otherwiseInvalidResultSetAccessExceptionResultSet.last()boolean next()
throws InvalidResultSetAccessException
true if the new row is valid, false if there are no more rowsInvalidResultSetAccessExceptionResultSet.next()boolean previous()
throws InvalidResultSetAccessException
true if the new row is valid, false if it is off the row setInvalidResultSetAccessExceptionResultSet.previous()boolean relative(int rows)
throws InvalidResultSetAccessException
true if the cursor is on a row, false otherwiseInvalidResultSetAccessExceptionResultSet.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 otherwiseInvalidResultSetAccessExceptionResultSet.wasNull()