Interface SqlRowSet
- All Superinterfaces:
- Serializable
- All Known Implementing Classes:
- ResultSetWrappingSqlRowSet
Mirror interface for 
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 an SqlRowSet to be used without having to deal with
 checked exceptions. An 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).
- Since:
- 1.2
- Author:
- Thomas Risberg, Juergen Hoeller
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptionbooleanabsolute(int row) Move the cursor to the given row number in the row set, just after the last row.voidMove the cursor to the end of this row set.voidMove the cursor to the front of this row set, just before the first row.intfindColumn(String columnLabel) Map the given column label to its column index.booleanfirst()Move the cursor to the first row of this row set.getBigDecimal(int columnIndex) Retrieve the value of the indicated column in the current row as a BigDecimal object.getBigDecimal(String columnLabel) Retrieve the value of the indicated column in the current row as a BigDecimal object.booleangetBoolean(int columnIndex) Retrieve the value of the indicated column in the current row as a boolean.booleangetBoolean(String columnLabel) Retrieve the value of the indicated column in the current row as a boolean.bytegetByte(int columnIndex) Retrieve the value of the indicated column in the current row as a byte.byteRetrieve the value of the indicated column in the current row as a byte.getDate(int columnIndex) Retrieve the value of the indicated column in the current row as a Date object.Retrieve the value of the indicated column in the current row as a Date object.Retrieve the value of the indicated column in the current row as a Date object.Retrieve the value of the indicated column in the current row as a Date object.doublegetDouble(int columnIndex) Retrieve the value of the indicated column in the current row as a Double object.doubleRetrieve the value of the indicated column in the current row as a Double object.floatgetFloat(int columnIndex) Retrieve the value of the indicated column in the current row as a float.floatRetrieve the value of the indicated column in the current row as a float.intgetInt(int columnIndex) Retrieve the value of the indicated column in the current row as an int.intRetrieve the value of the indicated column in the current row as an int.longgetLong(int columnIndex) Retrieve the value of the indicated column in the current row as a long.longRetrieve the value of the indicated column in the current row as a long.Retrieve the meta-data, i.e.getNString(int columnIndex) Retrieve the value of the indicated column in the current row as a String (for NCHAR, NVARCHAR, LONGNVARCHAR columns).getNString(String columnLabel) Retrieve the value of the indicated column in the current row as a String (for NCHAR, NVARCHAR, LONGNVARCHAR columns).getObject(int columnIndex) Retrieve the value of the indicated column in the current row as an Object.<T> TRetrieve the value of the indicated column in the current row as an Object.Retrieve the value of the indicated column in the current row as an Object.Retrieve the value of the indicated column in the current row as an Object.<T> TRetrieve the value of the indicated column in the current row as an Object.Retrieve the value of the indicated column in the current row as an Object.intgetRow()Retrieve the current row number.shortgetShort(int columnIndex) Retrieve the value of the indicated column in the current row as a short.shortRetrieve the value of the indicated column in the current row as a short.getString(int columnIndex) Retrieve the value of the indicated column in the current row as a String.Retrieve the value of the indicated column in the current row as a String.getTime(int columnIndex) Retrieve the value of the indicated column in the current row as a Time object.Retrieve the value of the indicated column in the current row as a Time object.Retrieve the value of the indicated column in the current row as a Time object.Retrieve the value of the indicated column in the current row as a Time object.getTimestamp(int columnIndex) Retrieve the value of the indicated column in the current row as a Timestamp object.getTimestamp(int columnIndex, Calendar cal) Retrieve the value of the indicated column in the current row as a Timestamp object.getTimestamp(String columnLabel) Retrieve the value of the indicated column in the current row as a Timestamp object.getTimestamp(String columnLabel, Calendar cal) Retrieve the value of the indicated column in the current row as a Timestamp object.booleanRetrieve whether the cursor is after the last row of this row set.booleanRetrieve whether the cursor is before the first row of this row set.booleanisFirst()Retrieve whether the cursor is on the first row of this row set.booleanisLast()Retrieve whether the cursor is on the last row of this row set.booleanlast()Move the cursor to the last row of this row set.booleannext()Move the cursor to the next row.booleanprevious()Move the cursor to the previous row.booleanrelative(int rows) Move the cursor a relative number of rows, either positive or negative.booleanwasNull()Report whether the last column read had a value of SQLNULL.
- 
Method Details- 
getMetaDataSqlRowSetMetaData getMetaData()Retrieve the meta-data, i.e. number, types and properties for the columns of this row set.- Returns:
- a corresponding SqlRowSetMetaData instance
- See Also:
 
- 
findColumnMap the given column label to its column index.- Parameters:
- columnLabel- the name of the column
- Returns:
- the column index for the given column label
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getBigDecimalRetrieve the value of the indicated column in the current row as a BigDecimal object.- Parameters:
- columnIndex- the column index
- Returns:
- an BigDecimal object representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getBigDecimalRetrieve the value of the indicated column in the current row as a BigDecimal object.- Parameters:
- columnLabel- the column label
- Returns:
- an BigDecimal object representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getBooleanRetrieve the value of the indicated column in the current row as a boolean.- Parameters:
- columnIndex- the column index
- Returns:
- a boolean representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getBooleanRetrieve the value of the indicated column in the current row as a boolean.- Parameters:
- columnLabel- the column label
- Returns:
- a boolean representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getByteRetrieve the value of the indicated column in the current row as a byte.- Parameters:
- columnIndex- the column index
- Returns:
- a byte representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getByteRetrieve the value of the indicated column in the current row as a byte.- Parameters:
- columnLabel- the column label
- Returns:
- a byte representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getDateRetrieve the value of the indicated column in the current row as a Date object.- Parameters:
- columnIndex- the column index
- Returns:
- a Date object representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getDateRetrieve the value of the indicated column in the current row as a Date object.- Parameters:
- columnLabel- the column label
- Returns:
- a Date object representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getDateRetrieve the value of the indicated column in the current row as a Date object.- Parameters:
- columnIndex- the column index
- cal- the Calendar to use in constructing the Date
- Returns:
- a Date object representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getDateRetrieve the value of the indicated column in the current row as a Date object.- Parameters:
- columnLabel- the column label
- cal- the Calendar to use in constructing the Date
- Returns:
- a Date object representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getDoubleRetrieve the value of the indicated column in the current row as a Double object.- Parameters:
- columnIndex- the column index
- Returns:
- a Double object representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getDoubleRetrieve the value of the indicated column in the current row as a Double object.- Parameters:
- columnLabel- the column label
- Returns:
- a Double object representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getFloatRetrieve the value of the indicated column in the current row as a float.- Parameters:
- columnIndex- the column index
- Returns:
- a float representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getFloatRetrieve the value of the indicated column in the current row as a float.- Parameters:
- columnLabel- the column label
- Returns:
- a float representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getIntRetrieve the value of the indicated column in the current row as an int.- Parameters:
- columnIndex- the column index
- Returns:
- an int representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getIntRetrieve the value of the indicated column in the current row as an int.- Parameters:
- columnLabel- the column label
- Returns:
- an int representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getLongRetrieve the value of the indicated column in the current row as a long.- Parameters:
- columnIndex- the column index
- Returns:
- a long representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getLongRetrieve the value of the indicated column in the current row as a long.- Parameters:
- columnLabel- the column label
- Returns:
- a long representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getNStringRetrieve the value of the indicated column in the current row as a String (for NCHAR, NVARCHAR, LONGNVARCHAR columns).- Parameters:
- columnIndex- the column index
- Returns:
- a String representing the column value
- Throws:
- InvalidResultSetAccessException
- Since:
- 4.1.3
- See Also:
 
- 
getNStringRetrieve the value of the indicated column in the current row as a String (for NCHAR, NVARCHAR, LONGNVARCHAR columns).- Parameters:
- columnLabel- the column label
- Returns:
- a String representing the column value
- Throws:
- InvalidResultSetAccessException
- Since:
- 4.1.3
- See Also:
 
- 
getObjectRetrieve the value of the indicated column in the current row as an Object.- Parameters:
- columnIndex- the column index
- Returns:
- an Object representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getObjectRetrieve the value of the indicated column in the current row as an Object.- Parameters:
- columnLabel- the column label
- Returns:
- an Object representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getObject@Nullable Object getObject(int columnIndex, Map<String, Class<?>> map) throws InvalidResultSetAccessExceptionRetrieve the value of the indicated column in the current row as an Object.- Parameters:
- columnIndex- the column index
- map- a Map object containing the mapping from SQL types to Java types
- Returns:
- an Object representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getObject@Nullable Object getObject(String columnLabel, Map<String, Class<?>> map) throws InvalidResultSetAccessExceptionRetrieve the value of the indicated column in the current row as an Object.- Parameters:
- columnLabel- the column label
- map- a Map object containing the mapping from SQL types to Java types
- Returns:
- an Object representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getObjectRetrieve the value of the indicated column in the current row as an Object.- Parameters:
- columnIndex- the column index
- type- the Java type to convert the designated column to
- Returns:
- an Object representing the column value
- Throws:
- InvalidResultSetAccessException
- Since:
- 4.1.3
- See Also:
 
- 
getObjectRetrieve the value of the indicated column in the current row as an Object.- Parameters:
- columnLabel- the column label
- type- the Java type to convert the designated column to
- Returns:
- an Object representing the column value
- Throws:
- InvalidResultSetAccessException
- Since:
- 4.1.3
- See Also:
 
- 
getShortRetrieve the value of the indicated column in the current row as a short.- Parameters:
- columnIndex- the column index
- Returns:
- a short representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getShortRetrieve the value of the indicated column in the current row as a short.- Parameters:
- columnLabel- the column label
- Returns:
- a short representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getStringRetrieve the value of the indicated column in the current row as a String.- Parameters:
- columnIndex- the column index
- Returns:
- a String representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getStringRetrieve the value of the indicated column in the current row as a String.- Parameters:
- columnLabel- the column label
- Returns:
- a String representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getTimeRetrieve the value of the indicated column in the current row as a Time object.- Parameters:
- columnIndex- the column index
- Returns:
- a Time object representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getTimeRetrieve the value of the indicated column in the current row as a Time object.- Parameters:
- columnLabel- the column label
- Returns:
- a Time object representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getTimeRetrieve the value of the indicated column in the current row as a Time object.- Parameters:
- columnIndex- the column index
- cal- the Calendar to use in constructing the Date
- Returns:
- a Time object representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getTimeRetrieve the value of the indicated column in the current row as a Time object.- Parameters:
- columnLabel- the column label
- cal- the Calendar to use in constructing the Date
- Returns:
- a Time object representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getTimestampRetrieve the value of the indicated column in the current row as a Timestamp object.- Parameters:
- columnIndex- the column index
- Returns:
- a Timestamp object representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getTimestampRetrieve the value of the indicated column in the current row as a Timestamp object.- Parameters:
- columnLabel- the column label
- Returns:
- a Timestamp object representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getTimestamp@Nullable Timestamp getTimestamp(int columnIndex, Calendar cal) throws InvalidResultSetAccessException Retrieve the value of the indicated column in the current row as a Timestamp object.- Parameters:
- columnIndex- the column index
- cal- the Calendar to use in constructing the Date
- Returns:
- a Timestamp object representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getTimestamp@Nullable Timestamp getTimestamp(String columnLabel, Calendar cal) throws InvalidResultSetAccessException Retrieve the value of the indicated column in the current row as a Timestamp object.- Parameters:
- columnLabel- the column label
- cal- the Calendar to use in constructing the Date
- Returns:
- a Timestamp object representing the column value
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
absoluteMove the cursor to the given row number in the row set, just after the last row.- Parameters:
- row- the number of the row where the cursor should move
- Returns:
- trueif the cursor is on the row set,- falseotherwise
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
afterLastMove the cursor to the end of this row set.- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
beforeFirstMove the cursor to the front of this row set, just before the first row.- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
firstMove the cursor to the first row of this row set.- Returns:
- trueif the cursor is on a valid row,- falseotherwise
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
getRowRetrieve the current row number.- Returns:
- the current row number
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
isAfterLastRetrieve whether the cursor is after the last row of this row set.- Returns:
- trueif the cursor is after the last row,- falseotherwise
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
isBeforeFirstRetrieve whether the cursor is before the first row of this row set.- Returns:
- trueif the cursor is before the first row,- falseotherwise
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
isFirstRetrieve whether the cursor is on the first row of this row set.- Returns:
- trueif the cursor is after the first row,- falseotherwise
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
isLastRetrieve whether the cursor is on the last row of this row set.- Returns:
- trueif the cursor is after the last row,- falseotherwise
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
lastMove the cursor to the last row of this row set.- Returns:
- trueif the cursor is on a valid row,- falseotherwise
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
nextMove the cursor to the next row.- Returns:
- trueif the new row is valid,- falseif there are no more rows
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
previousMove the cursor to the previous row.- Returns:
- trueif the new row is valid,- falseif it is off the row set
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
relativeMove the cursor a relative number of rows, either positive or negative.- Returns:
- trueif the cursor is on a row,- falseotherwise
- Throws:
- InvalidResultSetAccessException
- See Also:
 
- 
wasNullReport whether the last column read had a value of SQLNULL.Note that you must first call one of the getter methods and then call the wasNull()method.- Returns:
- trueif the most recent column retrieved was SQL- NULL,- falseotherwise
- Throws:
- InvalidResultSetAccessException
- See Also:
 
 
-