|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 DataAccessException.
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: 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 serializable.
ResultSet
,
CachedRowSet
,
Serialized FormConstructor Summary | |
---|---|
ResultSetWrappingSqlRowSet(ResultSet resultSet)
Create a new ResultSetWrappingSqlRowSet for the given ResultSet. |
Method Summary | |
---|---|
boolean |
absolute(int row)
Moves the cursor to the given row number in the RowSet, just after the last row. |
void |
afterLast()
Moves the cursor to the end of this RowSet. |
void |
beforeFirst()
Moves the cursor to the front of this RowSet, just before the first row. |
int |
findColumn(String columnName)
Maps the given column name to its column index. |
boolean |
first()
Moves the cursor to the first row of this RowSet. |
BigDecimal |
getBigDecimal(int columnIndex)
Retrieves the value of the indicated column in the current row as an BigDecimal object. |
BigDecimal |
getBigDecimal(String columnName)
Retrieves the value of the indicated column in the current row as an BigDecimal object. |
boolean |
getBoolean(int columnIndex)
Retrieves the value of the indicated column in the current row as a boolean. |
boolean |
getBoolean(String columnName)
Retrieves the value of the indicated column in the current row as a boolean. |
byte |
getByte(int columnIndex)
Retrieves the value of the indicated column in the current row as a byte. |
byte |
getByte(String columnName)
Retrieves the value of the indicated column in the current row as a byte. |
Date |
getDate(int columnIndex)
Retrieves the value of the indicated column in the current row as a Date object. |
Date |
getDate(int columnIndex,
Calendar cal)
Retrieves the value of the indicated column in the current row as a Date object. |
Date |
getDate(String columnName)
Retrieves the value of the indicated column in the current row as a Date object. |
Date |
getDate(String columnName,
Calendar cal)
Retrieves the value of the indicated column in the current row as a Date object. |
double |
getDouble(int columnIndex)
Retrieves the value of the indicated column in the current row as a Double object. |
double |
getDouble(String columnName)
Retrieves the value of the indicated column in the current row as a Double object. |
float |
getFloat(int columnIndex)
Retrieves the value of the indicated column in the current row as a float. |
float |
getFloat(String columnName)
Retrieves the value of the indicated column in the current row as a float. |
int |
getInt(int columnIndex)
Retrieves the value of the indicated column in the current row as an int. |
int |
getInt(String columnName)
Retrieves the value of the indicated column in the current row as an int. |
long |
getLong(int columnIndex)
Retrieves the value of the indicated column in the current row as a long. |
long |
getLong(String columnName)
Retrieves the value of the indicated column in the current row as a long. |
SqlRowSetMetaData |
getMetaData()
Retrieves the meta data (number, types and properties for the columns) of this row set. |
Object |
getObject(int columnIndex)
Retrieves the value of the indicated column in the current row as an Object. |
Object |
getObject(int i,
Map map)
Retrieves the value of the indicated column in the current row as an Object. |
Object |
getObject(String columnName)
Retrieves the value of the indicated column in the current row as an Object. |
Object |
getObject(String columnName,
Map map)
Retrieves the value of the indicated column in the current row as an Object. |
ResultSet |
getResultSet()
Return the underlying ResultSet (usually a javax.sql.rowset.CachedRowSet ). |
int |
getRow()
Retrieves the current row number. |
short |
getShort(int columnIndex)
Retrieves the value of the indicated column in the current row as a short. |
short |
getShort(String columnName)
Retrieves the value of the indicated column in the current row as a short. |
String |
getString(int columnIndex)
Retrieves the value of the indicated column in the current row as a String. |
String |
getString(String columnName)
Retrieves the value of the indicated column in the current row as a String. |
Time |
getTime(int columnIndex)
Retrieves the value of the indicated column in the current row as a Time object. |
Time |
getTime(int columnIndex,
Calendar cal)
Retrieves the value of the indicated column in the current row as a Time object. |
Time |
getTime(String columnName)
Retrieves the value of the indicated column in the current row as a Time object. |
Time |
getTime(String columnName,
Calendar cal)
Retrieves the value of the indicated column in the current row as a Time object. |
Timestamp |
getTimestamp(int columnIndex)
Retrieves the value of the indicated column in the current row as a Timestamp object. |
Timestamp |
getTimestamp(int columnIndex,
Calendar cal)
Retrieves the value of the indicated column in the current row as a Timestamp object. |
Timestamp |
getTimestamp(String columnName)
Retrieves the value of the indicated column in the current row as a Timestamp object. |
Timestamp |
getTimestamp(String columnName,
Calendar cal)
Retrieves the value of the indicated column in the current row as a Timestamp object. |
boolean |
isAfterLast()
Retrieves whether the cursor is after the last row of this RowSet. |
boolean |
isBeforeFirst()
Retrieves whether the cursor is after the first row of this RowSet. |
boolean |
isFirst()
Retrieves whether the cursor is on the first row of this RowSet. |
boolean |
isLast()
Retrieves whether the cursor is on the last row of this RowSet. |
boolean |
last()
Moves the cursor to the last row of this RowSet. |
boolean |
next()
Moves the cursor to the next row. |
boolean |
previous()
Moves the cursor to the previous row. |
boolean |
relative(int rows)
Moves the cursor a relative number f rows, either positive or negative. |
boolean |
wasNull()
Reports whether the last column read had a value of SQL NULL . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResultSetWrappingSqlRowSet(ResultSet resultSet) throws InvalidResultSetAccessException
resultSet
- a disconnected ResultSet to wrap
(usually a javax.sql.rowset.CachedRowSet
)
InvalidResultSetAccessException
- if extracting
the ResultSetMetaData failedCachedRowSet
,
ResultSet.getMetaData()
,
ResultSetWrappingSqlRowSetMetaData
Method Detail |
---|
public ResultSet getResultSet()
javax.sql.rowset.CachedRowSet
).
CachedRowSet
public SqlRowSetMetaData getMetaData()
SqlRowSet
getMetaData
in interface SqlRowSet
ResultSetMetaData.getCatalogName(int)
public int findColumn(String columnName) throws InvalidResultSetAccessException
SqlRowSet
findColumn
in interface SqlRowSet
columnName
- the name of the column
InvalidResultSetAccessException
ResultSet.findColumn(String)
public BigDecimal getBigDecimal(int columnIndex) throws InvalidResultSetAccessException
SqlRowSet
getBigDecimal
in interface SqlRowSet
columnIndex
- the column index
InvalidResultSetAccessException
ResultSet.getBigDecimal(int)
public BigDecimal getBigDecimal(String columnName) throws InvalidResultSetAccessException
SqlRowSet
getBigDecimal
in interface SqlRowSet
columnName
- the column name
InvalidResultSetAccessException
ResultSet.getBigDecimal(String)
public boolean getBoolean(int columnIndex) throws InvalidResultSetAccessException
SqlRowSet
getBoolean
in interface SqlRowSet
columnIndex
- the column index
InvalidResultSetAccessException
ResultSet.getBoolean(int)
public boolean getBoolean(String columnName) throws InvalidResultSetAccessException
SqlRowSet
getBoolean
in interface SqlRowSet
columnName
- the column name
InvalidResultSetAccessException
ResultSet.getBoolean(String)
public byte getByte(int columnIndex) throws InvalidResultSetAccessException
SqlRowSet
columnIndex
- the column index
InvalidResultSetAccessException
ResultSet.getByte(int)
public byte getByte(String columnName) throws InvalidResultSetAccessException
SqlRowSet
columnName
- the column name
InvalidResultSetAccessException
ResultSet.getByte(String)
public Date getDate(int columnIndex, Calendar cal) throws InvalidResultSetAccessException
SqlRowSet
columnIndex
- the column indexcal
- the Calendar to use in constructing the Date
InvalidResultSetAccessException
ResultSet.getDate(int, java.util.Calendar)
public Date getDate(int columnIndex) throws InvalidResultSetAccessException
SqlRowSet
columnIndex
- the column index
InvalidResultSetAccessException
ResultSet.getDate(int)
public Date getDate(String columnName, Calendar cal) throws InvalidResultSetAccessException
SqlRowSet
columnName
- the column namecal
- the Calendar to use in constructing the Date
InvalidResultSetAccessException
ResultSet.getDate(String, java.util.Calendar)
public Date getDate(String columnName) throws InvalidResultSetAccessException
SqlRowSet
columnName
- the column name
InvalidResultSetAccessException
ResultSet.getDate(String)
public double getDouble(int columnIndex) throws InvalidResultSetAccessException
SqlRowSet
columnIndex
- the column index
InvalidResultSetAccessException
ResultSet.getDouble(int)
public double getDouble(String columnName) throws InvalidResultSetAccessException
SqlRowSet
columnName
- the column name
InvalidResultSetAccessException
ResultSet.getDouble(String)
public float getFloat(int columnIndex) throws InvalidResultSetAccessException
SqlRowSet
columnIndex
- the column index
InvalidResultSetAccessException
ResultSet.getFloat(int)
public float getFloat(String columnName) throws InvalidResultSetAccessException
SqlRowSet
columnName
- the column name
InvalidResultSetAccessException
ResultSet.getFloat(String)
public int getInt(int columnIndex) throws InvalidResultSetAccessException
SqlRowSet
columnIndex
- the column index
InvalidResultSetAccessException
ResultSet.getInt(int)
public int getInt(String columnName) throws InvalidResultSetAccessException
SqlRowSet
columnName
- the column name
InvalidResultSetAccessException
ResultSet.getInt(String)
public long getLong(int columnIndex) throws InvalidResultSetAccessException
SqlRowSet
columnIndex
- the column index
InvalidResultSetAccessException
ResultSet.getLong(int)
public long getLong(String columnName) throws InvalidResultSetAccessException
SqlRowSet
columnName
- the column name
InvalidResultSetAccessException
ResultSet.getLong(String)
public Object getObject(int i, Map map) throws InvalidResultSetAccessException
SqlRowSet
i
- the column indexmap
- a Map object containing the mapping from SQL types to Java types
InvalidResultSetAccessException
ResultSet.getObject(int, java.util.Map)
public Object getObject(int columnIndex) throws InvalidResultSetAccessException
SqlRowSet
columnIndex
- the column index
InvalidResultSetAccessException
ResultSet.getObject(int)
public Object getObject(String columnName, Map map) throws InvalidResultSetAccessException
SqlRowSet
columnName
- the column namemap
- a Map object containing the mapping from SQL types to Java types
InvalidResultSetAccessException
ResultSet.getObject(String, java.util.Map)
public Object getObject(String columnName) throws InvalidResultSetAccessException
SqlRowSet
columnName
- the column name
InvalidResultSetAccessException
ResultSet.getObject(String)
public short getShort(int columnIndex) throws InvalidResultSetAccessException
SqlRowSet
columnIndex
- the column index
InvalidResultSetAccessException
ResultSet.getShort(int)
public short getShort(String columnName) throws InvalidResultSetAccessException
SqlRowSet
columnName
- the column name
InvalidResultSetAccessException
ResultSet.getShort(String)
public String getString(int columnIndex) throws InvalidResultSetAccessException
SqlRowSet
columnIndex
- the column index
InvalidResultSetAccessException
ResultSet.getString(int)
public String getString(String columnName) throws InvalidResultSetAccessException
SqlRowSet
columnName
- the column name
InvalidResultSetAccessException
ResultSet.getString(String)
public Time getTime(int columnIndex, Calendar cal) throws InvalidResultSetAccessException
SqlRowSet
columnIndex
- the column indexcal
- the Calendar to use in constructing the Date
InvalidResultSetAccessException
ResultSet.getTime(int, java.util.Calendar)
public Time getTime(int columnIndex) throws InvalidResultSetAccessException
SqlRowSet
columnIndex
- the column index
InvalidResultSetAccessException
ResultSet.getTime(int)
public Time getTime(String columnName, Calendar cal) throws InvalidResultSetAccessException
SqlRowSet
columnName
- the column namecal
- the Calendar to use in constructing the Date
InvalidResultSetAccessException
ResultSet.getTime(String, java.util.Calendar)
public Time getTime(String columnName) throws InvalidResultSetAccessException
SqlRowSet
columnName
- the column name
InvalidResultSetAccessException
ResultSet.getTime(String)
public Timestamp getTimestamp(int columnIndex, Calendar cal) throws InvalidResultSetAccessException
SqlRowSet
getTimestamp
in interface SqlRowSet
columnIndex
- the column indexcal
- the Calendar to use in constructing the Date
InvalidResultSetAccessException
ResultSet.getTimestamp(int, java.util.Calendar)
public Timestamp getTimestamp(int columnIndex) throws InvalidResultSetAccessException
SqlRowSet
getTimestamp
in interface SqlRowSet
columnIndex
- the column index
InvalidResultSetAccessException
ResultSet.getTimestamp(int)
public Timestamp getTimestamp(String columnName, Calendar cal) throws InvalidResultSetAccessException
SqlRowSet
getTimestamp
in interface SqlRowSet
columnName
- the column namecal
- the Calendar to use in constructing the Date
InvalidResultSetAccessException
ResultSet.getTimestamp(String, java.util.Calendar)
public Timestamp getTimestamp(String columnName) throws InvalidResultSetAccessException
SqlRowSet
getTimestamp
in interface SqlRowSet
columnName
- the column name
InvalidResultSetAccessException
ResultSet.getTimestamp(String)
public boolean absolute(int row) throws InvalidResultSetAccessException
SqlRowSet
row
- the number of the row where the cursor should move
InvalidResultSetAccessException
ResultSet.absolute(int)
public void afterLast() throws InvalidResultSetAccessException
SqlRowSet
InvalidResultSetAccessException
ResultSet.afterLast()
public void beforeFirst() throws InvalidResultSetAccessException
SqlRowSet
beforeFirst
in interface SqlRowSet
InvalidResultSetAccessException
ResultSet.beforeFirst()
public boolean first() throws InvalidResultSetAccessException
SqlRowSet
InvalidResultSetAccessException
ResultSet.first()
public int getRow() throws InvalidResultSetAccessException
SqlRowSet
InvalidResultSetAccessException
ResultSet.getRow()
public boolean isAfterLast() throws InvalidResultSetAccessException
SqlRowSet
isAfterLast
in interface SqlRowSet
InvalidResultSetAccessException
ResultSet.isAfterLast()
public boolean isBeforeFirst() throws InvalidResultSetAccessException
SqlRowSet
isBeforeFirst
in interface SqlRowSet
InvalidResultSetAccessException
ResultSet.isBeforeFirst()
public boolean isFirst() throws InvalidResultSetAccessException
SqlRowSet
InvalidResultSetAccessException
ResultSet.isFirst()
public boolean isLast() throws InvalidResultSetAccessException
SqlRowSet
InvalidResultSetAccessException
ResultSet.isLast()
public boolean last() throws InvalidResultSetAccessException
SqlRowSet
InvalidResultSetAccessException
ResultSet.last()
public boolean next() throws InvalidResultSetAccessException
SqlRowSet
InvalidResultSetAccessException
ResultSet.next()
public boolean previous() throws InvalidResultSetAccessException
SqlRowSet
InvalidResultSetAccessException
ResultSet.previous()
public boolean relative(int rows) throws InvalidResultSetAccessException
SqlRowSet
InvalidResultSetAccessException
ResultSet.relative(int)
public boolean wasNull() throws InvalidResultSetAccessException
SqlRowSet
NULL
.
Note that you must first call one of the getter methods and then call
the wasNull
method.
NULL
,
false otherwise
InvalidResultSetAccessException
ResultSet.wasNull()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |