Class ResultSetWrappingSqlRowSet
- java.lang.Object
- org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet
- All Implemented Interfaces:
Serializable,SqlRowSet
public class ResultSetWrappingSqlRowSet extends Object implements SqlRowSet
The default implementation of Spring'sSqlRowSetinterface, wrapping aResultSet, catching anySQLExceptions and translating them to a corresponding SpringInvalidResultSetAccessException.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 new pattern but there are exceptions such as the
com.sun.rowset.CachedRowSetImplclass 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 thecom.sun.rowset.CachedRowSetImplwhich is the default implementation used byJdbcTemplatewhen working with RowSets.Note: This class implements the
java.io.Serializablemarker 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.- Since:
- 1.2
- Author:
- Thomas Risberg, Juergen Hoeller
- See Also:
ResultSet,CachedRowSet,JdbcTemplate.queryForRowSet(java.lang.String), Serialized Form
Constructor Summary
Constructors Constructor Description ResultSetWrappingSqlRowSet(ResultSet resultSet)Create a new ResultSetWrappingSqlRowSet for the given ResultSet.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanabsolute(int row)Move the cursor to the given row number in the row set, just after the last row.voidafterLast()Move the cursor to the end of this row set.voidbeforeFirst()Move 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.BigDecimalgetBigDecimal(int columnIndex)Retrieve the value of the indicated column in the current row as a BigDecimal object.BigDecimalgetBigDecimal(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.bytegetByte(String columnLabel)Retrieve the value of the indicated column in the current row as a byte.DategetDate(int columnIndex)Retrieve the value of the indicated column in the current row as a Date object.DategetDate(int columnIndex, Calendar cal)Retrieve the value of the indicated column in the current row as a Date object.DategetDate(String columnLabel)Retrieve the value of the indicated column in the current row as a Date object.DategetDate(String columnLabel, Calendar cal)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.doublegetDouble(String columnLabel)Retrieve 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.floatgetFloat(String columnLabel)Retrieve 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.intgetInt(String columnLabel)Retrieve 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.longgetLong(String columnLabel)Retrieve the value of the indicated column in the current row as a long.SqlRowSetMetaDatagetMetaData()Retrieve the meta-data, i.e.StringgetNString(int columnIndex)Retrieve the value of the indicated column in the current row as a String (for NCHAR, NVARCHAR, LONGNVARCHAR columns).StringgetNString(String columnLabel)Retrieve the value of the indicated column in the current row as a String (for NCHAR, NVARCHAR, LONGNVARCHAR columns).ObjectgetObject(int columnIndex)Retrieve the value of the indicated column in the current row as an Object.<T> TgetObject(int columnIndex, Class<T> type)Retrieve the value of the indicated column in the current row as an Object.ObjectgetObject(int columnIndex, Map<String,Class<?>> map)Retrieve the value of the indicated column in the current row as an Object.ObjectgetObject(String columnLabel)Retrieve the value of the indicated column in the current row as an Object.<T> TgetObject(String columnLabel, Class<T> type)Retrieve the value of the indicated column in the current row as an Object.ObjectgetObject(String columnLabel, Map<String,Class<?>> map)Retrieve the value of the indicated column in the current row as an Object.ResultSetgetResultSet()Return the underlying ResultSet (usually ajavax.sql.rowset.CachedRowSet).intgetRow()Retrieve the current row number.shortgetShort(int columnIndex)Retrieve the value of the indicated column in the current row as a short.shortgetShort(String columnLabel)Retrieve the value of the indicated column in the current row as a short.StringgetString(int columnIndex)Retrieve the value of the indicated column in the current row as a String.StringgetString(String columnLabel)Retrieve the value of the indicated column in the current row as a String.TimegetTime(int columnIndex)Retrieve the value of the indicated column in the current row as a Time object.TimegetTime(int columnIndex, Calendar cal)Retrieve the value of the indicated column in the current row as a Time object.TimegetTime(String columnLabel)Retrieve the value of the indicated column in the current row as a Time object.TimegetTime(String columnLabel, Calendar cal)Retrieve the value of the indicated column in the current row as a Time object.TimestampgetTimestamp(int columnIndex)Retrieve the value of the indicated column in the current row as a Timestamp object.TimestampgetTimestamp(int columnIndex, Calendar cal)Retrieve the value of the indicated column in the current row as a Timestamp object.TimestampgetTimestamp(String columnLabel)Retrieve the value of the indicated column in the current row as a Timestamp object.TimestampgetTimestamp(String columnLabel, Calendar cal)Retrieve the value of the indicated column in the current row as a Timestamp object.booleanisAfterLast()Retrieve whether the cursor is after the last row of this row set.booleanisBeforeFirst()Retrieve 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.
Constructor Detail
ResultSetWrappingSqlRowSet
public ResultSetWrappingSqlRowSet(ResultSet resultSet) throws InvalidResultSetAccessException
Create a new ResultSetWrappingSqlRowSet for the given ResultSet.- Parameters:
resultSet- a disconnected ResultSet to wrap (usually ajavax.sql.rowset.CachedRowSet)- Throws:
InvalidResultSetAccessException- if extracting the ResultSetMetaData failed- See Also:
CachedRowSet,ResultSet.getMetaData(),ResultSetWrappingSqlRowSetMetaData
Method Detail
getResultSet
public final ResultSet getResultSet()
Return the underlying ResultSet (usually ajavax.sql.rowset.CachedRowSet).- See Also:
CachedRowSet
getMetaData
public final SqlRowSetMetaData getMetaData()
Description copied from interface:SqlRowSetRetrieve the meta-data, i.e. number, types and properties for the columns of this row set.- Specified by:
getMetaDatain interfaceSqlRowSet- Returns:
- a corresponding SqlRowSetMetaData instance
- See Also:
ResultSetMetaData.getCatalogName(int)
findColumn
public int findColumn(String columnLabel) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetMap the given column label to its column index.- Specified by:
findColumnin interfaceSqlRowSet- Parameters:
columnLabel- the name of the column- Returns:
- the column index for the given column label
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.findColumn(String)
getBigDecimal
public BigDecimal getBigDecimal(int columnIndex) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a BigDecimal object.- Specified by:
getBigDecimalin interfaceSqlRowSet- Parameters:
columnIndex- the column index- Returns:
- an BigDecimal object representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getBigDecimal(int)
getBigDecimal
public BigDecimal getBigDecimal(String columnLabel) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a BigDecimal object.- Specified by:
getBigDecimalin interfaceSqlRowSet- Parameters:
columnLabel- the column label- Returns:
- an BigDecimal object representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getBigDecimal(String)
getBoolean
public boolean getBoolean(int columnIndex) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a boolean.- Specified by:
getBooleanin interfaceSqlRowSet- Parameters:
columnIndex- the column index- Returns:
- a boolean representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getBoolean(int)
getBoolean
public boolean getBoolean(String columnLabel) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a boolean.- Specified by:
getBooleanin interfaceSqlRowSet- Parameters:
columnLabel- the column label- Returns:
- a boolean representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getBoolean(String)
getByte
public byte getByte(int columnIndex) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a byte.- Specified by:
getBytein interfaceSqlRowSet- Parameters:
columnIndex- the column index- Returns:
- a byte representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getByte(int)
getByte
public byte getByte(String columnLabel) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a byte.- Specified by:
getBytein interfaceSqlRowSet- Parameters:
columnLabel- the column label- Returns:
- a byte representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getByte(String)
getDate
public Date getDate(int columnIndex) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a Date object.- Specified by:
getDatein interfaceSqlRowSet- Parameters:
columnIndex- the column index- Returns:
- a Date object representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getDate(int)
getDate
public Date getDate(String columnLabel) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a Date object.- Specified by:
getDatein interfaceSqlRowSet- Parameters:
columnLabel- the column label- Returns:
- a Date object representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getDate(String)
getDate
public Date getDate(int columnIndex, Calendar cal) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a Date object.- Specified by:
getDatein interfaceSqlRowSet- Parameters:
columnIndex- the column indexcal- the Calendar to use in constructing the Date- Returns:
- a Date object representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getDate(int, Calendar)
getDate
public Date getDate(String columnLabel, Calendar cal) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a Date object.- Specified by:
getDatein interfaceSqlRowSet- Parameters:
columnLabel- the column labelcal- the Calendar to use in constructing the Date- Returns:
- a Date object representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getDate(String, Calendar)
getDouble
public double getDouble(int columnIndex) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a Double object.- Specified by:
getDoublein interfaceSqlRowSet- Parameters:
columnIndex- the column index- Returns:
- a Double object representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getDouble(int)
getDouble
public double getDouble(String columnLabel) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a Double object.- Specified by:
getDoublein interfaceSqlRowSet- Parameters:
columnLabel- the column label- Returns:
- a Double object representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getDouble(String)
getFloat
public float getFloat(int columnIndex) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a float.- Specified by:
getFloatin interfaceSqlRowSet- Parameters:
columnIndex- the column index- Returns:
- a float representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getFloat(int)
getFloat
public float getFloat(String columnLabel) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a float.- Specified by:
getFloatin interfaceSqlRowSet- Parameters:
columnLabel- the column label- Returns:
- a float representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getFloat(String)
getInt
public int getInt(int columnIndex) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as an int.- Specified by:
getIntin interfaceSqlRowSet- Parameters:
columnIndex- the column index- Returns:
- an int representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getInt(int)
getInt
public int getInt(String columnLabel) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as an int.- Specified by:
getIntin interfaceSqlRowSet- Parameters:
columnLabel- the column label- Returns:
- an int representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getInt(String)
getLong
public long getLong(int columnIndex) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a long.- Specified by:
getLongin interfaceSqlRowSet- Parameters:
columnIndex- the column index- Returns:
- a long representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getLong(int)
getLong
public long getLong(String columnLabel) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a long.- Specified by:
getLongin interfaceSqlRowSet- Parameters:
columnLabel- the column label- Returns:
- a long representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getLong(String)
getNString
public String getNString(int columnIndex) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a String (for NCHAR, NVARCHAR, LONGNVARCHAR columns).- Specified by:
getNStringin interfaceSqlRowSet- Parameters:
columnIndex- the column index- Returns:
- a String representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getNString(int)
getNString
public String getNString(String columnLabel) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a String (for NCHAR, NVARCHAR, LONGNVARCHAR columns).- Specified by:
getNStringin interfaceSqlRowSet- Parameters:
columnLabel- the column label- Returns:
- a String representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getNString(String)
getObject
public Object getObject(int columnIndex) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as an Object.- Specified by:
getObjectin interfaceSqlRowSet- Parameters:
columnIndex- the column index- Returns:
- a Object representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getObject(int)
getObject
public Object getObject(String columnLabel) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as an Object.- Specified by:
getObjectin interfaceSqlRowSet- Parameters:
columnLabel- the column label- Returns:
- a Object representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getObject(String)
getObject
public Object getObject(int columnIndex, Map<String,Class<?>> map) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as an Object.- Specified by:
getObjectin interfaceSqlRowSet- Parameters:
columnIndex- the column indexmap- a Map object containing the mapping from SQL types to Java types- Returns:
- a Object representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getObject(int, Map)
getObject
public Object getObject(String columnLabel, Map<String,Class<?>> map) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as an Object.- Specified by:
getObjectin interfaceSqlRowSet- Parameters:
columnLabel- the column labelmap- a Map object containing the mapping from SQL types to Java types- Returns:
- a Object representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getObject(String, Map)
getObject
@UsesJava7 public <T> T getObject(int columnIndex, Class<T> type) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as an Object.- Specified by:
getObjectin interfaceSqlRowSet- Parameters:
columnIndex- the column indextype- the Java type to convert the designated column to- Returns:
- a Object representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getObject(int, Class)
getObject
public <T> T getObject(String columnLabel, Class<T> type) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as an Object.- Specified by:
getObjectin interfaceSqlRowSet- Parameters:
columnLabel- the column labeltype- the Java type to convert the designated column to- Returns:
- a Object representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getObject(String, Class)
getShort
public short getShort(int columnIndex) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a short.- Specified by:
getShortin interfaceSqlRowSet- Parameters:
columnIndex- the column index- Returns:
- a short representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getShort(int)
getShort
public short getShort(String columnLabel) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a short.- Specified by:
getShortin interfaceSqlRowSet- Parameters:
columnLabel- the column label- Returns:
- a short representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getShort(String)
getString
public String getString(int columnIndex) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a String.- Specified by:
getStringin interfaceSqlRowSet- Parameters:
columnIndex- the column index- Returns:
- a String representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getString(int)
getString
public String getString(String columnLabel) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a String.- Specified by:
getStringin interfaceSqlRowSet- Parameters:
columnLabel- the column label- Returns:
- a String representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getString(String)
getTime
public Time getTime(int columnIndex) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a Time object.- Specified by:
getTimein interfaceSqlRowSet- Parameters:
columnIndex- the column index- Returns:
- a Time object representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getTime(int)
getTime
public Time getTime(String columnLabel) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a Time object.- Specified by:
getTimein interfaceSqlRowSet- Parameters:
columnLabel- the column label- Returns:
- a Time object representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getTime(String)
getTime
public Time getTime(int columnIndex, Calendar cal) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a Time object.- Specified by:
getTimein interfaceSqlRowSet- Parameters:
columnIndex- the column indexcal- the Calendar to use in constructing the Date- Returns:
- a Time object representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getTime(int, Calendar)
getTime
public Time getTime(String columnLabel, Calendar cal) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a Time object.- Specified by:
getTimein interfaceSqlRowSet- Parameters:
columnLabel- the column labelcal- the Calendar to use in constructing the Date- Returns:
- a Time object representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getTime(String, Calendar)
getTimestamp
public Timestamp getTimestamp(int columnIndex) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a Timestamp object.- Specified by:
getTimestampin interfaceSqlRowSet- Parameters:
columnIndex- the column index- Returns:
- a Timestamp object representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getTimestamp(int)
getTimestamp
public Timestamp getTimestamp(String columnLabel) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a Timestamp object.- Specified by:
getTimestampin interfaceSqlRowSet- Parameters:
columnLabel- the column label- Returns:
- a Timestamp object representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getTimestamp(String)
getTimestamp
public Timestamp getTimestamp(int columnIndex, Calendar cal) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a Timestamp object.- Specified by:
getTimestampin interfaceSqlRowSet- Parameters:
columnIndex- the column indexcal- the Calendar to use in constructing the Date- Returns:
- a Timestamp object representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getTimestamp(int, Calendar)
getTimestamp
public Timestamp getTimestamp(String columnLabel, Calendar cal) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the value of the indicated column in the current row as a Timestamp object.- Specified by:
getTimestampin interfaceSqlRowSet- Parameters:
columnLabel- the column labelcal- the Calendar to use in constructing the Date- Returns:
- a Timestamp object representing the column value
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getTimestamp(String, Calendar)
absolute
public boolean absolute(int row) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetMove the cursor to the given row number in the row set, just after the last row.- Specified by:
absolutein interfaceSqlRowSet- 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:
ResultSet.absolute(int)
afterLast
public void afterLast() throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetMove the cursor to the end of this row set.- Specified by:
afterLastin interfaceSqlRowSet- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.afterLast()
beforeFirst
public void beforeFirst() throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetMove the cursor to the front of this row set, just before the first row.- Specified by:
beforeFirstin interfaceSqlRowSet- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.beforeFirst()
first
public boolean first() throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetMove the cursor to the first row of this row set.- Specified by:
firstin interfaceSqlRowSet- Returns:
trueif the cursor is on a valid row,falseotherwise- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.first()
getRow
public int getRow() throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve the current row number.- Specified by:
getRowin interfaceSqlRowSet- Returns:
- the current row number
- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.getRow()
isAfterLast
public boolean isAfterLast() throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve whether the cursor is after the last row of this row set.- Specified by:
isAfterLastin interfaceSqlRowSet- Returns:
trueif the cursor is after the last row,falseotherwise- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.isAfterLast()
isBeforeFirst
public boolean isBeforeFirst() throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve whether the cursor is before the first row of this row set.- Specified by:
isBeforeFirstin interfaceSqlRowSet- Returns:
trueif the cursor is before the first row,falseotherwise- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.isBeforeFirst()
isFirst
public boolean isFirst() throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve whether the cursor is on the first row of this row set.- Specified by:
isFirstin interfaceSqlRowSet- Returns:
trueif the cursor is after the first row,falseotherwise- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.isFirst()
isLast
public boolean isLast() throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetRetrieve whether the cursor is on the last row of this row set.- Specified by:
isLastin interfaceSqlRowSet- Returns:
trueif the cursor is after the last row,falseotherwise- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.isLast()
last
public boolean last() throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetMove the cursor to the last row of this row set.- Specified by:
lastin interfaceSqlRowSet- Returns:
trueif the cursor is on a valid row,falseotherwise- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.last()
next
public boolean next() throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetMove the cursor to the next row.- Specified by:
nextin interfaceSqlRowSet- Returns:
trueif the new row is valid,falseif there are no more rows- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.next()
previous
public boolean previous() throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetMove the cursor to the previous row.- Specified by:
previousin interfaceSqlRowSet- Returns:
trueif the new row is valid,falseif it is off the row set- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.previous()
relative
public boolean relative(int rows) throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetMove the cursor a relative number of rows, either positive or negative.- Specified by:
relativein interfaceSqlRowSet- Returns:
trueif the cursor is on a row,falseotherwise- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.relative(int)
wasNull
public boolean wasNull() throws InvalidResultSetAccessException
Description copied from interface:SqlRowSetReport 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.- Specified by:
wasNullin interfaceSqlRowSet- Returns:
trueif the most recent column retrieved was SQLNULL,falseotherwise- Throws:
InvalidResultSetAccessException- See Also:
ResultSet.wasNull()