SqlRowSet interface, wrapping a
java.sql.ResultSet , catching any SQLExceptions and
translating them to a corresponding Spring InvalidResultSetAccessException.
The passed-in ResultSet 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 pattern, but there are
exceptions such as the com.sun.rowset.CachedRowSetImpl class which only uses
the column name, ignoring any column labels. ResultSetWrappingSqlRowSet
will translate column labels to the correct column index to provide better support for
com.sun.rowset.CachedRowSetImpl which is the default implementation used by
org. 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 serialization should usually work.
java.sql.ResultSet , javax.sql.rowset.CachedRowSet , org.springframework.jdbc.core.JdbcTemplate#queryForRowSet
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private final ResultSet | |
| private final SqlRowSetMetaData | |
| private static final long | serialVersionUID
use serialVersionUID from Spring 1.2 for interoperability. |
| Access | Constructor and Description |
|---|---|
| public | ResultSetWrappingSqlRowSet(ResultSet
a disconnected ResultSet to wrap
(usually a resultSet)javax.sql.rowset.CachedRowSet)Create a new |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | absolute(int
the number of the row where the cursor should move row)Implements org. |
| public void | afterLast()
Implements org. |
| public void | beforeFirst()
Implements org. |
| public int | findColumn(String
the name of the column columnLabel)Implements org. |
| public boolean | first()
Implements org. |
| public BigDecimal | getBigDecimal(int
the column index columnIndex)Implements org. |
| public BigDecimal | getBigDecimal(String
the column label columnLabel)Implements org. |
| public boolean | getBoolean(int
the column index columnIndex)Implements org. |
| public boolean | getBoolean(String
the column label columnLabel)Implements org. |
| public byte | getByte(int
the column index columnIndex)Implements org. |
| public byte | getByte(String
the column label columnLabel)Implements org. |
| public Date | getDate(int
the column index columnIndex)Implements org. |
| public Date | getDate(String
the column label columnLabel)Implements org. |
| public Date | getDate(int
the column index columnIndex, Calendar the Calendar to use in constructing the Date cal)Implements org. |
| public Date | getDate(String
the column label columnLabel, Calendar the Calendar to use in constructing the Date cal)Implements org. |
| public double | getDouble(int
the column index columnIndex)Implements org. |
| public double | getDouble(String
the column label columnLabel)Implements org. |
| public float | getFloat(int
the column index columnIndex)Implements org. |
| public float | getFloat(String
the column label columnLabel)Implements org. |
| public int | getInt(int
the column index columnIndex)Implements org. |
| public int | getInt(String
the column label columnLabel)Implements org. |
| public long | getLong(int
the column index columnIndex)Implements org. |
| public long | getLong(String
the column label columnLabel)Implements org. |
| public final SqlRowSetMetaData | getMetaData()
Implements org. |
| public String | getNString(int
the column index columnIndex)Implements org. |
| public String | getNString(String
the column label columnLabel)Implements org. |
| public Object | getObject(int
the column index columnIndex)Implements org. |
| public Object | getObject(String
the column label columnLabel)Implements org. |
| public Object | getObject(int
the column index columnIndex, Map<String, Class<?>> a Map object containing the mapping from SQL types to Java types map)Implements org. |
| public Object | |
| public <T> T | getObject(int
the column index columnIndex, Class<T> the Java type to convert the designated column to type)Implements org. |
| public <T> T | getObject(String
the column label columnLabel, Class<T> the Java type to convert the designated column to type)Implements org. |
| public final ResultSet | |
| public int | getRow()
Implements org. |
| public short | getShort(int
the column index columnIndex)Implements org. |
| public short | getShort(String
the column label columnLabel)Implements org. |
| public String | getString(int
the column index columnIndex)Implements org. |
| public String | getString(String
the column label columnLabel)Implements org. |
| public Time | getTime(int
the column index columnIndex)Implements org. |
| public Time | getTime(String
the column label columnLabel)Implements org. |
| public Time | getTime(int
the column index columnIndex, Calendar the Calendar to use in constructing the Date cal)Implements org. |
| public Time | getTime(String
the column label columnLabel, Calendar the Calendar to use in constructing the Date cal)Implements org. |
| public Timestamp | getTimestamp(int
the column index columnIndex)Implements org. |
| public Timestamp | getTimestamp(String
the column label columnLabel)Implements org. |
| public Timestamp | getTimestamp(int
the column index columnIndex, Calendar the Calendar to use in constructing the Date cal)Implements org. |
| public Timestamp | getTimestamp(String
the column label columnLabel, Calendar the Calendar to use in constructing the Date cal)Implements org. |
| public boolean | isAfterLast()
Implements org. |
| public boolean | isBeforeFirst()
Implements org. |
| public boolean | isFirst()
Implements org. |
| public boolean | isLast()
Implements org. |
| public boolean | last()
Implements org. |
| public boolean | next()
Implements org. |
| public boolean | previous()
Implements org. |
| public boolean | relative(int rows)
Implements org. |
| public boolean | wasNull()
Implements org. NULL.
|