spring-framework / org.springframework.jdbc.support.rowset / ResultSetWrappingSqlRowSet

ResultSetWrappingSqlRowSet

open class ResultSetWrappingSqlRowSet : SqlRowSet

The default implementation of Spring's 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 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 org.springframework.jdbc.core.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.

Author
Thomas Risberg

Author
Juergen Hoeller

Since
1.2

See Also
java.sql.ResultSetjavax.sql.rowset.CachedRowSetorg.springframework.jdbc.core.JdbcTemplate#queryForRowSet

Constructors

<init>

ResultSetWrappingSqlRowSet(resultSet: ResultSet)

Create a new ResultSetWrappingSqlRowSet for the given ResultSet.

Functions

absolute

open fun absolute(row: Int): Boolean

afterLast

open fun afterLast(): Unit

beforeFirst

open fun beforeFirst(): Unit

findColumn

open fun findColumn(columnLabel: String): Int

first

open fun first(): Boolean

getBigDecimal

open fun getBigDecimal(columnIndex: Int): BigDecimal
open fun getBigDecimal(columnLabel: String): BigDecimal

getBoolean

open fun getBoolean(columnIndex: Int): Boolean
open fun getBoolean(columnLabel: String): Boolean

getByte

open fun getByte(columnIndex: Int): Byte
open fun getByte(columnLabel: String): Byte

getDate

open fun getDate(columnIndex: Int): Date
open fun getDate(columnLabel: String): Date
open fun getDate(columnIndex: Int, cal: Calendar): Date
open fun getDate(columnLabel: String, cal: Calendar): Date

getDouble

open fun getDouble(columnIndex: Int): Double
open fun getDouble(columnLabel: String): Double

getFloat

open fun getFloat(columnIndex: Int): Float
open fun getFloat(columnLabel: String): Float

getInt

open fun getInt(columnIndex: Int): Int
open fun getInt(columnLabel: String): Int

getLong

open fun getLong(columnIndex: Int): Long
open fun getLong(columnLabel: String): Long

getMetaData

fun getMetaData(): SqlRowSetMetaData

getNString

open fun getNString(columnIndex: Int): String
open fun getNString(columnLabel: String): String

getObject

open fun getObject(columnIndex: Int): Any
open fun getObject(columnLabel: String): Any
open fun getObject(columnIndex: Int, map: MutableMap<String, Class<*>>): Any
open fun getObject(columnLabel: String, map: MutableMap<String, Class<*>>): Any
open fun <T : Any> getObject(columnIndex: Int, type: Class<T>): T
open fun <T : Any> getObject(columnLabel: String, type: Class<T>): T

getResultSet

fun getResultSet(): ResultSet

Return the underlying ResultSet (usually a javax.sql.rowset.CachedRowSet).

getRow

open fun getRow(): Int

getShort

open fun getShort(columnIndex: Int): Short
open fun getShort(columnLabel: String): Short

getString

open fun getString(columnIndex: Int): String
open fun getString(columnLabel: String): String

getTime

open fun getTime(columnIndex: Int): Time
open fun getTime(columnLabel: String): Time
open fun getTime(columnIndex: Int, cal: Calendar): Time
open fun getTime(columnLabel: String, cal: Calendar): Time

getTimestamp

open fun getTimestamp(columnIndex: Int): Timestamp
open fun getTimestamp(columnLabel: String): Timestamp
open fun getTimestamp(columnIndex: Int, cal: Calendar): Timestamp
open fun getTimestamp(columnLabel: String, cal: Calendar): Timestamp

isAfterLast

open fun isAfterLast(): Boolean

isBeforeFirst

open fun isBeforeFirst(): Boolean

isFirst

open fun isFirst(): Boolean

isLast

open fun isLast(): Boolean

last

open fun last(): Boolean

next

open fun next(): Boolean

previous

open fun previous(): Boolean

relative

open fun relative(rows: Int): Boolean

wasNull

open fun wasNull(): Boolean