java.lang.Object | |
↳ | org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet |
Default implementation of Spring's SqlRowSet
interface.
This implementation wraps a javax.sql.ResultSet
, catching any SQLExceptions
and translating them to the appropriate Spring InvalidResultSetAccessException
.
The passed-in ResultSets should already be disconnected if the SqlRowSet is supposed
to be usable in a disconnected fashion. This means that you will usually pass in a
javax.sql.rowset.CachedRowSet
, which implements the ResultSet interface.
Note: Since JDBC 4.0, it has been clarified that any methods using a String to identify
the column should be using the column label. The column label is assigned using the ALIAS
keyword in the SQL query string. When the query doesn't use an ALIAS, the default label is
the column name. Most JDBC ResultSet implementations follow this new pattern but there are
exceptions such as the com.sun.rowset.CachedRowSetImpl
class which only uses
the column name, ignoring any column labels. As of Spring 3.0.5, ResultSetWrappingSqlRowSet
will translate column labels to the correct column index to provide better support for the
com.sun.rowset.CachedRowSetImpl
which is the default implementation used by
JdbcTemplate
when working with RowSets.
Note: This class implements the java.io.Serializable
marker interface
through the SqlRowSet interface, but is only actually serializable if the disconnected
ResultSet/RowSet contained in it is serializable. Most CachedRowSet implementations
are actually serializable, so this should usually work out.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new ResultSetWrappingSqlRowSet for the given ResultSet.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Moves the cursor to the given row number in the RowSet, just after the last row.
| |||||||||||
Moves the cursor to the end of this RowSet.
| |||||||||||
Moves the cursor to the front of this RowSet, just before the first row.
| |||||||||||
Maps the given column label to its column index.
| |||||||||||
Moves the cursor to the first row of this RowSet.
| |||||||||||
Retrieves the value of the indicated column in the current row as
an BigDecimal object.
| |||||||||||
Retrieves the value of the indicated column in the current row as
an BigDecimal object.
| |||||||||||
Retrieves the value of the indicated column in the current row as
a boolean.
| |||||||||||
Retrieves the value of the indicated column in the current row as
a boolean.
| |||||||||||
Retrieves the value of the indicated column in the current row as
a byte.
| |||||||||||
Retrieves the value of the indicated column in the current row as
a byte.
| |||||||||||
Retrieves the value of the indicated column in the current row as
a Date object.
| |||||||||||
Retrieves the value of the indicated column in the current row as
a Date object.
| |||||||||||
Retrieves the value of the indicated column in the current row as
a Date object.
| |||||||||||
Retrieves the value of the indicated column in the current row as
a Date object.
| |||||||||||
Retrieves the value of the indicated column in the current row as
a Double object.
| |||||||||||
Retrieves the value of the indicated column in the current row as
a Double object.
| |||||||||||
Retrieves the value of the indicated column in the current row as
a float.
| |||||||||||
Retrieves the value of the indicated column in the current row as
a float.
| |||||||||||
Retrieves the value of the indicated column in the current row as
an int.
| |||||||||||
Retrieves the value of the indicated column in the current row as
an int.
| |||||||||||
Retrieves the value of the indicated column in the current row as
a long.
| |||||||||||
Retrieves the value of the indicated column in the current row as
a long.
| |||||||||||
Retrieves the meta data (number, types and properties for the columns)
of this row set.
| |||||||||||
Retrieves the value of the indicated column in the current row as
an Object.
| |||||||||||
Retrieves the value of the indicated column in the current row as
an Object.
| |||||||||||
Retrieves the value of the indicated column in the current row as
an Object.
| |||||||||||
Retrieves the value of the indicated column in the current row as
an Object.
| |||||||||||
Return the underlying ResultSet
(usually a
javax.sql.rowset.CachedRowSet ). | |||||||||||
Retrieves the current row number.
| |||||||||||
Retrieves the value of the indicated column in the current row as
a short.
| |||||||||||
Retrieves the value of the indicated column in the current row as
a short.
| |||||||||||
Retrieves the value of the indicated column in the current row as
a String.
| |||||||||||
Retrieves the value of the indicated column in the current row as
a String.
| |||||||||||
Retrieves the value of the indicated column in the current row as
a Time object.
| |||||||||||
Retrieves the value of the indicated column in the current row as
a Time object.
| |||||||||||
Retrieves the value of the indicated column in the current row as
a Time object.
| |||||||||||
Retrieves the value of the indicated column in the current row as
a Time object.
| |||||||||||
Retrieves the value of the indicated column in the current row as
a Timestamp object.
| |||||||||||
Retrieves the value of the indicated column in the current row as
a Timestamp object.
| |||||||||||
Retrieves the value of the indicated column in the current row as
a Timestamp object.
| |||||||||||
Retrieves the value of the indicated column in the current row as
a Timestamp object.
| |||||||||||
Retrieves whether the cursor is after the last row of this RowSet.
| |||||||||||
Retrieves whether the cursor is after the first row of this RowSet.
| |||||||||||
Retrieves whether the cursor is on the first row of this RowSet.
| |||||||||||
Retrieves whether the cursor is on the last row of this RowSet.
| |||||||||||
Moves the cursor to the last row of this RowSet.
| |||||||||||
Moves the cursor to the next row.
| |||||||||||
Moves the cursor to the previous row.
| |||||||||||
Moves the cursor a relative number f rows, either positive or negative.
| |||||||||||
Reports whether the last column read had a value of SQL
NULL . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.jdbc.support.rowset.SqlRowSet
|
Create a new ResultSetWrappingSqlRowSet for the given ResultSet.
resultSet | a disconnected ResultSet to wrap
(usually a javax.sql.rowset.CachedRowSet ) |
---|
InvalidResultSetAccessException | if extracting the ResultSetMetaData failed |
---|
Moves the cursor to the given row number in the RowSet, just after the last row.
row | the number of the row where the cursor should move |
---|
Moves the cursor to the end of this RowSet.
Moves the cursor to the front of this RowSet, just before the first row.
Maps the given column label to its column index.
columnLabel | the name of the column |
---|
Moves the cursor to the first row of this RowSet.
Retrieves the value of the indicated column in the current row as an BigDecimal object.
columnIndex | the column index |
---|
Retrieves the value of the indicated column in the current row as an BigDecimal object.
columnLabel | the column label |
---|
Retrieves the value of the indicated column in the current row as a boolean.
columnIndex | the column index |
---|
Retrieves the value of the indicated column in the current row as a boolean.
columnLabel | the column label |
---|
Retrieves the value of the indicated column in the current row as a byte.
columnLabel | the column label |
---|
Retrieves the value of the indicated column in the current row as a byte.
columnIndex | the column index |
---|
Retrieves the value of the indicated column in the current row as a Date object.
columnIndex | the column index |
---|---|
cal | the Calendar to use in constructing the Date |
Retrieves the value of the indicated column in the current row as a Date object.
columnIndex | the column index |
---|
Retrieves the value of the indicated column in the current row as a Date object.
columnLabel | the column label |
---|---|
cal | the Calendar to use in constructing the Date |
Retrieves the value of the indicated column in the current row as a Date object.
columnLabel | the column label |
---|
Retrieves the value of the indicated column in the current row as a Double object.
columnLabel | the column label |
---|
Retrieves the value of the indicated column in the current row as a Double object.
columnIndex | the column index |
---|
Retrieves the value of the indicated column in the current row as a float.
columnIndex | the column index |
---|
Retrieves the value of the indicated column in the current row as a float.
columnLabel | the column label |
---|
Retrieves the value of the indicated column in the current row as an int.
columnLabel | the column label |
---|
Retrieves the value of the indicated column in the current row as an int.
columnIndex | the column index |
---|
Retrieves the value of the indicated column in the current row as a long.
columnLabel | the column label |
---|
Retrieves the value of the indicated column in the current row as a long.
columnIndex | the column index |
---|
Retrieves the meta data (number, types and properties for the columns) of this row set.
Retrieves the value of the indicated column in the current row as an Object.
i | the column index |
---|---|
map | a Map object containing the mapping from SQL types to Java types |
Retrieves the value of the indicated column in the current row as an Object.
columnLabel | the column label |
---|
Retrieves the value of the indicated column in the current row as an Object.
columnLabel | the column label |
---|---|
map | a Map object containing the mapping from SQL types to Java types |
Retrieves the value of the indicated column in the current row as an Object.
columnIndex | the column index |
---|
Return the underlying ResultSet
(usually a javax.sql.rowset.CachedRowSet
).
Retrieves the current row number.
Retrieves the value of the indicated column in the current row as a short.
columnIndex | the column index |
---|
Retrieves the value of the indicated column in the current row as a short.
columnLabel | the column label |
---|
Retrieves the value of the indicated column in the current row as a String.
columnIndex | the column index |
---|
Retrieves the value of the indicated column in the current row as a String.
columnLabel | the column label |
---|
Retrieves the value of the indicated column in the current row as a Time object.
columnLabel | the column label |
---|
Retrieves the value of the indicated column in the current row as a Time object.
columnIndex | the column index |
---|---|
cal | the Calendar to use in constructing the Date |
Retrieves the value of the indicated column in the current row as a Time object.
columnIndex | the column index |
---|
Retrieves the value of the indicated column in the current row as a Time object.
columnLabel | the column label |
---|---|
cal | the Calendar to use in constructing the Date |
Retrieves the value of the indicated column in the current row as a Timestamp object.
columnLabel | the column label |
---|
Retrieves the value of the indicated column in the current row as a Timestamp object.
columnLabel | the column label |
---|---|
cal | the Calendar to use in constructing the Date |
Retrieves the value of the indicated column in the current row as a Timestamp object.
columnIndex | the column index |
---|---|
cal | the Calendar to use in constructing the Date |
Retrieves the value of the indicated column in the current row as a Timestamp object.
columnIndex | the column index |
---|
Retrieves whether the cursor is after the last row of this RowSet.
Retrieves whether the cursor is after the first row of this RowSet.
Retrieves whether the cursor is on the first row of this RowSet.
Retrieves whether the cursor is on the last row of this RowSet.
Moves the cursor to the last row of this RowSet.
Moves the cursor to the next row.
Moves the cursor to the previous row.
Moves the cursor a relative number f rows, either positive or negative.
Reports whether the last column read had a value of SQL NULL
.
Note that you must first call one of the getter methods and then call
the wasNull
method.
NULL
,
false otherwise