Interface JdbcRowSet
- All Superinterfaces:
AutoCloseable, Joinable, ResultSet, RowSet, Wrapper
JdbcRowSet
must implement.
1.0 Overview
A wrapper around aResultSet
object that makes it possible
to use the result set as a JavaBeans
component. Thus, a JdbcRowSet
object can be one of the Beans that
a tool makes available for composing an application. Because
a JdbcRowSet
is a connected rowset, that is, it continually
maintains its connection to a database using a JDBC technology-enabled
driver, it also effectively makes the driver a JavaBeans component.
Because it is always connected to its database, an instance of
JdbcRowSet
can simply take calls invoked on it and in turn call them on its
ResultSet
object. As a consequence, a result set can, for
example, be a component in a Swing application.
Another advantage of a JdbcRowSet
object is that it can be
used to make a ResultSet
object scrollable and updatable. All
RowSet
objects are by default scrollable and updatable. If
the driver and database being used do not support scrolling and/or updating
of result sets, an application can populate a JdbcRowSet
object
with the data of a ResultSet
object and then operate on the
JdbcRowSet
object as if it were the ResultSet
object.
2.0 Creating a JdbcRowSet
Object
The reference implementation of the JdbcRowSet
interface,
JdbcRowSetImpl
, provides an implementation of
the default constructor. A new instance is initialized with
default values, which can be set with new values as needed. A
new instance is not really functional until its execute
method is called. In general, this method does the following:
- establishes a connection with a database
- creates a
PreparedStatement
object and sets any of its placeholder parameters - executes the statement to create a
ResultSet
object
execute
method is successful, it will set the
appropriate private JdbcRowSet
fields with the following:
- a
Connection
object -- the connection between the rowset and the database - a
PreparedStatement
object -- the query that produces the result set - a
ResultSet
object -- the result set that the rowset's command produced and that is being made, in effect, a JavaBeans component
execute
method has not executed successfully, no methods other than
execute
and close
may be called on the
rowset. All other public methods will throw an exception.
Before calling the execute
method, however, the command
and properties needed for establishing a connection must be set.
The following code fragment creates a JdbcRowSetImpl
object,
sets the command and connection properties, sets the placeholder parameter,
and then invokes the method execute
.
JdbcRowSetImpl jrs = new JdbcRowSetImpl(); jrs.setCommand("SELECT * FROM TITLES WHERE TYPE = ?"); jrs.setURL("jdbc:myDriver:myAttribute"); jrs.setUsername("cervantes"); jrs.setPassword("sancho"); jrs.setString(1, "BIOGRAPHY"); jrs.execute();The variable
jrs
now represents an instance of
JdbcRowSetImpl
that is a thin wrapper around the
ResultSet
object containing all the rows in the
table TITLES
where the type of book is biography.
At this point, operations called on jrs
will
affect the rows in the result set, which is effectively a JavaBeans
component.
The implementation of the RowSet
method execute
in the
JdbcRowSet
reference implementation differs from that in the
CachedRowSet
reference implementation to account for the different
requirements of connected and disconnected RowSet
objects.
- Since:
- 1.5
-
Field Summary
Fields declared in interface ResultSet
CLOSE_CURSORS_AT_COMMIT, CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, HOLD_CURSORS_OVER_COMMIT, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE
Modifier and TypeFieldDescriptionstatic final int
The constant indicating that openResultSet
objects with this holdability will be closed when the current transaction is committed.static final int
The constant indicating the concurrency mode for aResultSet
object that may NOT be updated.static final int
The constant indicating the concurrency mode for aResultSet
object that may be updated.static final int
The constant indicating that the rows in a result set will be processed in a forward direction; first-to-last.static final int
The constant indicating that the rows in a result set will be processed in a reverse direction; last-to-first.static final int
The constant indicating that the order in which rows in a result set will be processed is unknown.static final int
The constant indicating that openResultSet
objects with this holdability will remain open when the current transaction is committed.static final int
The constant indicating the type for aResultSet
object whose cursor may move only forward.static final int
The constant indicating the type for aResultSet
object that is scrollable but generally not sensitive to changes to the data that underlies theResultSet
.static final int
The constant indicating the type for aResultSet
object that is scrollable and generally sensitive to changes to the data that underlies theResultSet
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
commit()
EachJdbcRowSet
contains aConnection
object from theResultSet
or JDBC properties passed to it's constructors.boolean
EachJdbcRowSet
contains aConnection
object from the originalResultSet
or JDBC properties passed to it.Retrieves the first warning reported by calls on thisJdbcRowSet
object.boolean
Retrieves aboolean
indicating whether rows marked for deletion appear in the set of current rows.void
rollback()
EachJdbcRowSet
contains aConnection
object from the originalResultSet
or JDBC properties passed to it.void
EachJdbcRowSet
contains aConnection
object from the originalResultSet
or JDBC properties passed to it.void
setAutoCommit
(boolean autoCommit) EachJdbcRowSet
contains aConnection
object from the originalResultSet
or JDBC properties passed to it.void
setShowDeleted
(boolean b) Sets the propertyshowDeleted
to the givenboolean
value.Methods declared in interface Joinable
getMatchColumnIndexes, getMatchColumnNames, setMatchColumn, setMatchColumn, setMatchColumn, setMatchColumn, unsetMatchColumn, unsetMatchColumn, unsetMatchColumn, unsetMatchColumn
Modifier and TypeMethodDescriptionint[]
Retrieves the indexes of the match columns that were set for thisRowSet
object with the methodsetMatchColumn(int[] columnIdxes)
.String[]
Retrieves the names of the match columns that were set for thisRowSet
object with the methodsetMatchColumn(String [] columnNames)
.void
setMatchColumn
(int columnIdx) Sets the designated column as the match column for thisRowSet
object.void
setMatchColumn
(int[] columnIdxes) Sets the designated columns as the match column for thisRowSet
object.void
setMatchColumn
(String columnName) Sets the designated column as the match column for thisRowSet
object.void
setMatchColumn
(String[] columnNames) Sets the designated columns as the match column for thisRowSet
object.void
unsetMatchColumn
(int columnIdx) Unsets the designated column as the match column for thisRowSet
object.void
unsetMatchColumn
(int[] columnIdxes) Unsets the designated columns as the match column for thisRowSet
object.void
unsetMatchColumn
(String columnName) Unsets the designated column as the match column for thisRowSet
object.void
unsetMatchColumn
(String[] columnName) Unsets the designated columns as the match columns for thisRowSet
object.Methods declared in interface ResultSet
absolute, afterLast, beforeFirst, cancelRowUpdates, clearWarnings, close, deleteRow, findColumn, first, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getConcurrency, getCursorName, getDate, getDate, getDate, getDate, getDouble, getDouble, getFetchDirection, getFetchSize, getFloat, getFloat, getHoldability, getInt, getInt, getLong, getLong, getMetaData, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getObject, getObject, getRef, getRef, getRow, getRowId, getRowId, getShort, getShort, getSQLXML, getSQLXML, getStatement, getString, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, isAfterLast, isBeforeFirst, isClosed, isFirst, isLast, last, moveToCurrentRow, moveToInsertRow, next, previous, refreshRow, relative, rowDeleted, rowInserted, rowUpdated, setFetchDirection, setFetchSize, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateClob, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNString, updateNString, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateRowId, updateRowId, updateShort, updateShort, updateSQLXML, updateSQLXML, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp, wasNull
Modifier and TypeMethodDescriptionboolean
absolute
(int row) Moves the cursor to the given row number in thisResultSet
object.void
Moves the cursor to the end of thisResultSet
object, just after the last row.void
Moves the cursor to the front of thisResultSet
object, just before the first row.void
Cancels the updates made to the current row in thisResultSet
object.void
Clears all warnings reported on thisResultSet
object.void
close()
Releases thisResultSet
object's database and JDBC resources immediately instead of waiting for this to happen when it is automatically closed.void
Deletes the current row from thisResultSet
object and from the underlying database.int
findColumn
(String columnLabel) Maps the givenResultSet
column label to itsResultSet
column index.boolean
first()
Moves the cursor to the first row in thisResultSet
object.getArray
(int columnIndex) Retrieves the value of the designated column in the current row of thisResultSet
object as anArray
object in the Java programming language.Retrieves the value of the designated column in the current row of thisResultSet
object as anArray
object in the Java programming language.getAsciiStream
(int columnIndex) Retrieves the value of the designated column in the current row of thisResultSet
object as a stream of ASCII characters.getAsciiStream
(String columnLabel) Retrieves the value of the designated column in the current row of thisResultSet
object as a stream of ASCII characters.getBigDecimal
(int columnIndex) Retrieves the value of the designated column in the current row of thisResultSet
object as ajava.math.BigDecimal
with full precision.getBigDecimal
(int columnIndex, int scale) Deprecated.getBigDecimal
(String columnLabel) Retrieves the value of the designated column in the current row of thisResultSet
object as ajava.math.BigDecimal
with full precision.getBigDecimal
(String columnLabel, int scale) Deprecated.UsegetBigDecimal(int columnIndex)
orgetBigDecimal(String columnLabel)
getBinaryStream
(int columnIndex) Retrieves the value of the designated column in the current row of thisResultSet
object as a stream of uninterpreted bytes.getBinaryStream
(String columnLabel) Retrieves the value of the designated column in the current row of thisResultSet
object as a stream of uninterpretedbyte
s.getBlob
(int columnIndex) Retrieves the value of the designated column in the current row of thisResultSet
object as aBlob
object in the Java programming language.Retrieves the value of the designated column in the current row of thisResultSet
object as aBlob
object in the Java programming language.boolean
getBoolean
(int columnIndex) Retrieves the value of the designated column in the current row of thisResultSet
object as aboolean
in the Java programming language.boolean
getBoolean
(String columnLabel) Retrieves the value of the designated column in the current row of thisResultSet
object as aboolean
in the Java programming language.byte
getByte
(int columnIndex) Retrieves the value of the designated column in the current row of thisResultSet
object as abyte
in the Java programming language.byte
Retrieves the value of the designated column in the current row of thisResultSet
object as abyte
in the Java programming language.byte[]
getBytes
(int columnIndex) Retrieves the value of the designated column in the current row of thisResultSet
object as abyte
array in the Java programming language.byte[]
Retrieves the value of the designated column in the current row of thisResultSet
object as abyte
array in the Java programming language.getCharacterStream
(int columnIndex) Retrieves the value of the designated column in the current row of thisResultSet
object as ajava.io.Reader
object.getCharacterStream
(String columnLabel) Retrieves the value of the designated column in the current row of thisResultSet
object as ajava.io.Reader
object.getClob
(int columnIndex) Retrieves the value of the designated column in the current row of thisResultSet
object as aClob
object in the Java programming language.Retrieves the value of the designated column in the current row of thisResultSet
object as aClob
object in the Java programming language.int
Retrieves the concurrency mode of thisResultSet
object.Retrieves the name of the SQL cursor used by thisResultSet
object.getDate
(int columnIndex) Retrieves the value of the designated column in the current row of thisResultSet
object as ajava.sql.Date
object in the Java programming language.Retrieves the value of the designated column in the current row of thisResultSet
object as ajava.sql.Date
object in the Java programming language.Retrieves the value of the designated column in the current row of thisResultSet
object as ajava.sql.Date
object in the Java programming language.Retrieves the value of the designated column in the current row of thisResultSet
object as ajava.sql.Date
object in the Java programming language.double
getDouble
(int columnIndex) Retrieves the value of the designated column in the current row of thisResultSet
object as adouble
in the Java programming language.double
Retrieves the value of the designated column in the current row of thisResultSet
object as adouble
in the Java programming language.int
Retrieves the fetch direction for thisResultSet
object.int
Retrieves the fetch size for thisResultSet
object.float
getFloat
(int columnIndex) Retrieves the value of the designated column in the current row of thisResultSet
object as afloat
in the Java programming language.float
Retrieves the value of the designated column in the current row of thisResultSet
object as afloat
in the Java programming language.int
Retrieves the holdability of thisResultSet
objectint
getInt
(int columnIndex) Retrieves the value of the designated column in the current row of thisResultSet
object as anint
in the Java programming language.int
Retrieves the value of the designated column in the current row of thisResultSet
object as anint
in the Java programming language.long
getLong
(int columnIndex) Retrieves the value of the designated column in the current row of thisResultSet
object as along
in the Java programming language.long
Retrieves the value of the designated column in the current row of thisResultSet
object as along
in the Java programming language.Retrieves the number, types and properties of thisResultSet
object's columns.getNCharacterStream
(int columnIndex) Retrieves the value of the designated column in the current row of thisResultSet
object as ajava.io.Reader
object.getNCharacterStream
(String columnLabel) Retrieves the value of the designated column in the current row of thisResultSet
object as ajava.io.Reader
object.getNClob
(int columnIndex) Retrieves the value of the designated column in the current row of thisResultSet
object as aNClob
object in the Java programming language.Retrieves the value of the designated column in the current row of thisResultSet
object as aNClob
object in the Java programming language.getNString
(int columnIndex) Retrieves the value of the designated column in the current row of thisResultSet
object as aString
in the Java programming language.getNString
(String columnLabel) Retrieves the value of the designated column in the current row of thisResultSet
object as aString
in the Java programming language.getObject
(int columnIndex) Gets the value of the designated column in the current row of thisResultSet
object as anObject
in the Java programming language.<T> T
Retrieves the value of the designated column in the current row of thisResultSet
object and will convert from the SQL type of the column to the requested Java data type, if the conversion is supported.Retrieves the value of the designated column in the current row of thisResultSet
object as anObject
in the Java programming language.Gets the value of the designated column in the current row of thisResultSet
object as anObject
in the Java programming language.<T> T
Retrieves the value of the designated column in the current row of thisResultSet
object and will convert from the SQL type of the column to the requested Java data type, if the conversion is supported.Retrieves the value of the designated column in the current row of thisResultSet
object as anObject
in the Java programming language.getRef
(int columnIndex) Retrieves the value of the designated column in the current row of thisResultSet
object as aRef
object in the Java programming language.Retrieves the value of the designated column in the current row of thisResultSet
object as aRef
object in the Java programming language.int
getRow()
Retrieves the current row number.getRowId
(int columnIndex) Retrieves the value of the designated column in the current row of thisResultSet
object as ajava.sql.RowId
object in the Java programming language.Retrieves the value of the designated column in the current row of thisResultSet
object as ajava.sql.RowId
object in the Java programming language.short
getShort
(int columnIndex) Retrieves the value of the designated column in the current row of thisResultSet
object as ashort
in the Java programming language.short
Retrieves the value of the designated column in the current row of thisResultSet
object as ashort
in the Java programming language.getSQLXML
(int columnIndex) Retrieves the value of the designated column in the current row of thisResultSet
as ajava.sql.SQLXML
object in the Java programming language.Retrieves the value of the designated column in the current row of thisResultSet
as ajava.sql.SQLXML
object in the Java programming language.Retrieves theStatement
object that produced thisResultSet
object.getString
(int columnIndex) Retrieves the value of the designated column in the current row of thisResultSet
object as aString
in the Java programming language.Retrieves the value of the designated column in the current row of thisResultSet
object as aString
in the Java programming language.getTime
(int columnIndex) Retrieves the value of the designated column in the current row of thisResultSet
object as ajava.sql.Time
object in the Java programming language.Retrieves the value of the designated column in the current row of thisResultSet
object as ajava.sql.Time
object in the Java programming language.Retrieves the value of the designated column in the current row of thisResultSet
object as ajava.sql.Time
object in the Java programming language.Retrieves the value of the designated column in the current row of thisResultSet
object as ajava.sql.Time
object in the Java programming language.getTimestamp
(int columnIndex) Retrieves the value of the designated column in the current row of thisResultSet
object as ajava.sql.Timestamp
object in the Java programming language.getTimestamp
(int columnIndex, Calendar cal) Retrieves the value of the designated column in the current row of thisResultSet
object as ajava.sql.Timestamp
object in the Java programming language.getTimestamp
(String columnLabel) Retrieves the value of the designated column in the current row of thisResultSet
object as ajava.sql.Timestamp
object in the Java programming language.getTimestamp
(String columnLabel, Calendar cal) Retrieves the value of the designated column in the current row of thisResultSet
object as ajava.sql.Timestamp
object in the Java programming language.int
getType()
Retrieves the type of thisResultSet
object.getUnicodeStream
(int columnIndex) Deprecated.usegetCharacterStream
in place ofgetUnicodeStream
getUnicodeStream
(String columnLabel) Deprecated.usegetCharacterStream
insteadgetURL
(int columnIndex) Retrieves the value of the designated column in the current row of thisResultSet
object as ajava.net.URL
object in the Java programming language.Retrieves the value of the designated column in the current row of thisResultSet
object as ajava.net.URL
object in the Java programming language.Retrieves the first warning reported by calls on thisResultSet
object.void
Inserts the contents of the insert row into thisResultSet
object and into the database.boolean
Retrieves whether the cursor is after the last row in thisResultSet
object.boolean
Retrieves whether the cursor is before the first row in thisResultSet
object.boolean
isClosed()
Retrieves whether thisResultSet
object has been closed.boolean
isFirst()
Retrieves whether the cursor is on the first row of thisResultSet
object.boolean
isLast()
Retrieves whether the cursor is on the last row of thisResultSet
object.boolean
last()
Moves the cursor to the last row in thisResultSet
object.void
Moves the cursor to the remembered cursor position, usually the current row.void
Moves the cursor to the insert row.boolean
next()
Moves the cursor forward one row from its current position.boolean
previous()
Moves the cursor to the previous row in thisResultSet
object.void
Refreshes the current row with its most recent value in the database.boolean
relative
(int rows) Moves the cursor a relative number of rows, either positive or negative.boolean
Retrieves whether a row has been deleted.boolean
Retrieves whether the current row has had an insertion.boolean
Retrieves whether the current row has been updated.void
setFetchDirection
(int direction) Gives a hint as to the direction in which the rows in thisResultSet
object will be processed.void
setFetchSize
(int rows) Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed for thisResultSet
object.void
updateArray
(int columnIndex, Array x) Updates the designated column with ajava.sql.Array
value.void
updateArray
(String columnLabel, Array x) Updates the designated column with ajava.sql.Array
value.void
updateAsciiStream
(int columnIndex, InputStream x) Updates the designated column with an ascii stream value.void
updateAsciiStream
(int columnIndex, InputStream x, int length) Updates the designated column with an ascii stream value, which will have the specified number of bytes.void
updateAsciiStream
(int columnIndex, InputStream x, long length) Updates the designated column with an ascii stream value, which will have the specified number of bytes.void
updateAsciiStream
(String columnLabel, InputStream x) Updates the designated column with an ascii stream value.void
updateAsciiStream
(String columnLabel, InputStream x, int length) Updates the designated column with an ascii stream value, which will have the specified number of bytes.void
updateAsciiStream
(String columnLabel, InputStream x, long length) Updates the designated column with an ascii stream value, which will have the specified number of bytes.void
updateBigDecimal
(int columnIndex, BigDecimal x) Updates the designated column with ajava.math.BigDecimal
value.void
updateBigDecimal
(String columnLabel, BigDecimal x) Updates the designated column with ajava.sql.BigDecimal
value.void
updateBinaryStream
(int columnIndex, InputStream x) Updates the designated column with a binary stream value.void
updateBinaryStream
(int columnIndex, InputStream x, int length) Updates the designated column with a binary stream value, which will have the specified number of bytes.void
updateBinaryStream
(int columnIndex, InputStream x, long length) Updates the designated column with a binary stream value, which will have the specified number of bytes.void
updateBinaryStream
(String columnLabel, InputStream x) Updates the designated column with a binary stream value.void
updateBinaryStream
(String columnLabel, InputStream x, int length) Updates the designated column with a binary stream value, which will have the specified number of bytes.void
updateBinaryStream
(String columnLabel, InputStream x, long length) Updates the designated column with a binary stream value, which will have the specified number of bytes.void
updateBlob
(int columnIndex, InputStream inputStream) Updates the designated column using the given input stream.void
updateBlob
(int columnIndex, InputStream inputStream, long length) Updates the designated column using the given input stream, which will have the specified number of bytes.void
updateBlob
(int columnIndex, Blob x) Updates the designated column with ajava.sql.Blob
value.void
updateBlob
(String columnLabel, InputStream inputStream) Updates the designated column using the given input stream.void
updateBlob
(String columnLabel, InputStream inputStream, long length) Updates the designated column using the given input stream, which will have the specified number of bytes.void
updateBlob
(String columnLabel, Blob x) Updates the designated column with ajava.sql.Blob
value.void
updateBoolean
(int columnIndex, boolean x) Updates the designated column with aboolean
value.void
updateBoolean
(String columnLabel, boolean x) Updates the designated column with aboolean
value.void
updateByte
(int columnIndex, byte x) Updates the designated column with abyte
value.void
updateByte
(String columnLabel, byte x) Updates the designated column with abyte
value.void
updateBytes
(int columnIndex, byte[] x) Updates the designated column with abyte
array value.void
updateBytes
(String columnLabel, byte[] x) Updates the designated column with a byte array value.void
updateCharacterStream
(int columnIndex, Reader x) Updates the designated column with a character stream value.void
updateCharacterStream
(int columnIndex, Reader x, int length) Updates the designated column with a character stream value, which will have the specified number of bytes.void
updateCharacterStream
(int columnIndex, Reader x, long length) Updates the designated column with a character stream value, which will have the specified number of bytes.void
updateCharacterStream
(String columnLabel, Reader reader) Updates the designated column with a character stream value.void
updateCharacterStream
(String columnLabel, Reader reader, int length) Updates the designated column with a character stream value, which will have the specified number of bytes.void
updateCharacterStream
(String columnLabel, Reader reader, long length) Updates the designated column with a character stream value, which will have the specified number of bytes.void
updateClob
(int columnIndex, Reader reader) Updates the designated column using the givenReader
object.void
updateClob
(int columnIndex, Reader reader, long length) Updates the designated column using the givenReader
object, which is the given number of characters long.void
updateClob
(int columnIndex, Clob x) Updates the designated column with ajava.sql.Clob
value.void
updateClob
(String columnLabel, Reader reader) Updates the designated column using the givenReader
object.void
updateClob
(String columnLabel, Reader reader, long length) Updates the designated column using the givenReader
object, which is the given number of characters long.void
updateClob
(String columnLabel, Clob x) Updates the designated column with ajava.sql.Clob
value.void
updateDate
(int columnIndex, Date x) Updates the designated column with ajava.sql.Date
value.void
updateDate
(String columnLabel, Date x) Updates the designated column with ajava.sql.Date
value.void
updateDouble
(int columnIndex, double x) Updates the designated column with adouble
value.void
updateDouble
(String columnLabel, double x) Updates the designated column with adouble
value.void
updateFloat
(int columnIndex, float x) Updates the designated column with afloat
value.void
updateFloat
(String columnLabel, float x) Updates the designated column with afloat
value.void
updateInt
(int columnIndex, int x) Updates the designated column with anint
value.void
Updates the designated column with anint
value.void
updateLong
(int columnIndex, long x) Updates the designated column with along
value.void
updateLong
(String columnLabel, long x) Updates the designated column with along
value.void
updateNCharacterStream
(int columnIndex, Reader x) Updates the designated column with a character stream value.void
updateNCharacterStream
(int columnIndex, Reader x, long length) Updates the designated column with a character stream value, which will have the specified number of bytes.void
updateNCharacterStream
(String columnLabel, Reader reader) Updates the designated column with a character stream value.void
updateNCharacterStream
(String columnLabel, Reader reader, long length) Updates the designated column with a character stream value, which will have the specified number of bytes.void
updateNClob
(int columnIndex, Reader reader) Updates the designated column using the givenReader
The data will be read from the stream as needed until end-of-stream is reached.void
updateNClob
(int columnIndex, Reader reader, long length) Updates the designated column using the givenReader
object, which is the given number of characters long.void
updateNClob
(int columnIndex, NClob nClob) Updates the designated column with ajava.sql.NClob
value.void
updateNClob
(String columnLabel, Reader reader) Updates the designated column using the givenReader
object.void
updateNClob
(String columnLabel, Reader reader, long length) Updates the designated column using the givenReader
object, which is the given number of characters long.void
updateNClob
(String columnLabel, NClob nClob) Updates the designated column with ajava.sql.NClob
value.void
updateNString
(int columnIndex, String nString) Updates the designated column with aString
value.void
updateNString
(String columnLabel, String nString) Updates the designated column with aString
value.void
updateNull
(int columnIndex) Updates the designated column with anull
value.void
updateNull
(String columnLabel) Updates the designated column with anull
value.void
updateObject
(int columnIndex, Object x) Updates the designated column with anObject
value.void
updateObject
(int columnIndex, Object x, int scaleOrLength) Updates the designated column with anObject
value.default void
updateObject
(int columnIndex, Object x, SQLType targetSqlType) Updates the designated column with anObject
value.default void
updateObject
(int columnIndex, Object x, SQLType targetSqlType, int scaleOrLength) Updates the designated column with anObject
value.void
updateObject
(String columnLabel, Object x) Updates the designated column with anObject
value.void
updateObject
(String columnLabel, Object x, int scaleOrLength) Updates the designated column with anObject
value.default void
updateObject
(String columnLabel, Object x, SQLType targetSqlType) Updates the designated column with anObject
value.default void
updateObject
(String columnLabel, Object x, SQLType targetSqlType, int scaleOrLength) Updates the designated column with anObject
value.void
Updates the designated column with ajava.sql.Ref
value.void
Updates the designated column with ajava.sql.Ref
value.void
Updates the underlying database with the new contents of the current row of thisResultSet
object.void
updateRowId
(int columnIndex, RowId x) Updates the designated column with aRowId
value.void
updateRowId
(String columnLabel, RowId x) Updates the designated column with aRowId
value.void
updateShort
(int columnIndex, short x) Updates the designated column with ashort
value.void
updateShort
(String columnLabel, short x) Updates the designated column with ashort
value.void
updateSQLXML
(int columnIndex, SQLXML xmlObject) Updates the designated column with ajava.sql.SQLXML
value.void
updateSQLXML
(String columnLabel, SQLXML xmlObject) Updates the designated column with ajava.sql.SQLXML
value.void
updateString
(int columnIndex, String x) Updates the designated column with aString
value.void
updateString
(String columnLabel, String x) Updates the designated column with aString
value.void
updateTime
(int columnIndex, Time x) Updates the designated column with ajava.sql.Time
value.void
updateTime
(String columnLabel, Time x) Updates the designated column with ajava.sql.Time
value.void
updateTimestamp
(int columnIndex, Timestamp x) Updates the designated column with ajava.sql.Timestamp
value.void
updateTimestamp
(String columnLabel, Timestamp x) Updates the designated column with ajava.sql.Timestamp
value.boolean
wasNull()
Reports whether the last column read had a value of SQLNULL
.Methods declared in interface RowSet
addRowSetListener, clearParameters, execute, getCommand, getDataSourceName, getEscapeProcessing, getMaxFieldSize, getMaxRows, getPassword, getQueryTimeout, getTransactionIsolation, getTypeMap, getUrl, getUsername, isReadOnly, removeRowSetListener, setArray, setAsciiStream, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBlob, setBlob, setBlob, setBoolean, setBoolean, setByte, setByte, setBytes, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setClob, setClob, setClob, setCommand, setConcurrency, setDataSourceName, setDate, setDate, setDate, setDate, setDouble, setDouble, setEscapeProcessing, setFloat, setFloat, setInt, setInt, setLong, setLong, setMaxFieldSize, setMaxRows, setNCharacterStream, setNCharacterStream, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNClob, setNClob, setNClob, setNString, setNString, setNull, setNull, setNull, setNull, setObject, setObject, setObject, setObject, setObject, setObject, setPassword, setQueryTimeout, setReadOnly, setRef, setRowId, setRowId, setShort, setShort, setSQLXML, setSQLXML, setString, setString, setTime, setTime, setTime, setTime, setTimestamp, setTimestamp, setTimestamp, setTimestamp, setTransactionIsolation, setType, setTypeMap, setUrl, setURL, setUsername
Modifier and TypeMethodDescriptionvoid
addRowSetListener
(RowSetListener listener) Registers the given listener so that it will be notified of events that occur on thisRowSet
object.void
Clears the parameters set for thisRowSet
object's command.void
execute()
Fills thisRowSet
object with data.Retrieves thisRowSet
object's command property.Retrieves the logical name that identifies the data source for thisRowSet
object.boolean
Retrieves whether escape processing is enabled for thisRowSet
object.int
Retrieves the maximum number of bytes that may be returned for certain column values.int
Retrieves the maximum number of rows that thisRowSet
object can contain.Retrieves the password used to create a database connection.int
Retrieves the maximum number of seconds the driver will wait for a statement to execute.int
Retrieves the transaction isolation level set for thisRowSet
object.Retrieves theMap
object associated with thisRowSet
object, which specifies the custom mapping of SQL user-defined types, if any.getUrl()
Retrieves the url property thisRowSet
object will use to create a connection if it uses theDriverManager
instead of aDataSource
object to establish the connection.Retrieves the username used to create a database connection for thisRowSet
object.boolean
Retrieves whether thisRowSet
object is read-only.void
removeRowSetListener
(RowSetListener listener) Removes the specified listener from the list of components that will be notified when an event occurs on thisRowSet
object.void
Sets the designated parameter in thisRowSet
object's command with the givenArray
value.void
setAsciiStream
(int parameterIndex, InputStream x) Sets the designated parameter in thisRowSet
object's command to the given input stream.void
setAsciiStream
(int parameterIndex, InputStream x, int length) Sets the designated parameter in thisRowSet
object's command to the givenjava.io.InputStream
value.void
setAsciiStream
(String parameterName, InputStream x) Sets the designated parameter to the given input stream.void
setAsciiStream
(String parameterName, InputStream x, int length) Sets the designated parameter to the given input stream, which will have the specified number of bytes.void
setBigDecimal
(int parameterIndex, BigDecimal x) Sets the designated parameter in thisRowSet
object's command to the givenjava.math.BigDecimal
value.void
setBigDecimal
(String parameterName, BigDecimal x) Sets the designated parameter to the givenjava.math.BigDecimal
value.void
setBinaryStream
(int parameterIndex, InputStream x) Sets the designated parameter in thisRowSet
object's command to the given input stream.void
setBinaryStream
(int parameterIndex, InputStream x, int length) Sets the designated parameter in thisRowSet
object's command to the givenjava.io.InputStream
value.void
setBinaryStream
(String parameterName, InputStream x) Sets the designated parameter to the given input stream.void
setBinaryStream
(String parameterName, InputStream x, int length) Sets the designated parameter to the given input stream, which will have the specified number of bytes.void
setBlob
(int parameterIndex, InputStream inputStream) Sets the designated parameter to aInputStream
object.void
setBlob
(int parameterIndex, InputStream inputStream, long length) Sets the designated parameter to aInputStream
object.void
Sets the designated parameter in thisRowSet
object's command with the givenBlob
value.void
setBlob
(String parameterName, InputStream inputStream) Sets the designated parameter to aInputStream
object.void
setBlob
(String parameterName, InputStream inputStream, long length) Sets the designated parameter to aInputStream
object.void
Sets the designated parameter to the givenjava.sql.Blob
object.void
setBoolean
(int parameterIndex, boolean x) Sets the designated parameter in thisRowSet
object's command to the given Javaboolean
value.void
setBoolean
(String parameterName, boolean x) Sets the designated parameter to the given Javaboolean
value.void
setByte
(int parameterIndex, byte x) Sets the designated parameter in thisRowSet
object's command to the given Javabyte
value.void
Sets the designated parameter to the given Javabyte
value.void
setBytes
(int parameterIndex, byte[] x) Sets the designated parameter in thisRowSet
object's command to the given Java array ofbyte
values.void
Sets the designated parameter to the given Java array of bytes.void
setCharacterStream
(int parameterIndex, Reader reader) Sets the designated parameter in thisRowSet
object's command to the givenReader
object.void
setCharacterStream
(int parameterIndex, Reader reader, int length) Sets the designated parameter in thisRowSet
object's command to the givenjava.io.Reader
value.void
setCharacterStream
(String parameterName, Reader reader) Sets the designated parameter to the givenReader
object.void
setCharacterStream
(String parameterName, Reader reader, int length) Sets the designated parameter to the givenReader
object, which is the given number of characters long.void
Sets the designated parameter to aReader
object.void
Sets the designated parameter to aReader
object.void
Sets the designated parameter in thisRowSet
object's command with the givenClob
value.void
Sets the designated parameter to aReader
object.void
Sets the designated parameter to aReader
object.void
Sets the designated parameter to the givenjava.sql.Clob
object.void
setCommand
(String cmd) Sets thisRowSet
object's command property to the given SQL query.void
setConcurrency
(int concurrency) Sets the concurrency of thisRowSet
object to the given concurrency level.void
setDataSourceName
(String name) Sets the data source name property for thisRowSet
object to the givenString
.void
Sets the designated parameter in thisRowSet
object's command to the givenjava.sql.Date
value.void
Sets the designated parameter in thisRowSet
object's command with the givenjava.sql.Date
value.void
Sets the designated parameter to the givenjava.sql.Date
value using the default time zone of the virtual machine that is running the application.void
Sets the designated parameter to the givenjava.sql.Date
value, using the givenCalendar
object.void
setDouble
(int parameterIndex, double x) Sets the designated parameter in thisRowSet
object's command to the given Javadouble
value.void
Sets the designated parameter to the given Javadouble
value.void
setEscapeProcessing
(boolean enable) Sets escape processing for thisRowSet
object on or off.void
setFloat
(int parameterIndex, float x) Sets the designated parameter in thisRowSet
object's command to the given Javafloat
value.void
Sets the designated parameter to the given Javafloat
value.void
setInt
(int parameterIndex, int x) Sets the designated parameter in thisRowSet
object's command to the given Javaint
value.void
Sets the designated parameter to the given Javaint
value.void
setLong
(int parameterIndex, long x) Sets the designated parameter in thisRowSet
object's command to the given Javalong
value.void
Sets the designated parameter to the given Javalong
value.void
setMaxFieldSize
(int max) Sets the maximum number of bytes that can be returned for a column value to the given number of bytes.void
setMaxRows
(int max) Sets the maximum number of rows that thisRowSet
object can contain to the specified number.void
setNCharacterStream
(int parameterIndex, Reader value) Sets the designated parameter in thisRowSet
object's command to aReader
object.void
setNCharacterStream
(int parameterIndex, Reader value, long length) Sets the designated parameter to aReader
object.void
setNCharacterStream
(String parameterName, Reader value) Sets the designated parameter to aReader
object.void
setNCharacterStream
(String parameterName, Reader value, long length) Sets the designated parameter to aReader
object.void
Sets the designated parameter to aReader
object.void
Sets the designated parameter to aReader
object.void
Sets the designated parameter to ajava.sql.NClob
object.void
Sets the designated parameter to aReader
object.void
Sets the designated parameter to aReader
object.void
Sets the designated parameter to ajava.sql.NClob
object.void
setNString
(int parameterIndex, String value) Sets the designated parameter to the givenString
object.void
setNString
(String parameterName, String value) Sets the designated parameter to the givenString
object.void
setNull
(int parameterIndex, int sqlType) Sets the designated parameter in thisRowSet
object's SQL command to SQLNULL
.void
Sets the designated parameter in thisRowSet
object's SQL command to SQLNULL
.void
Sets the designated parameter to SQLNULL
.void
Sets the designated parameter to SQLNULL
.void
Sets the designated parameter in thisRowSet
object's command with a JavaObject
.void
Sets the designated parameter in thisRowSet
object's command with a JavaObject
.void
Sets the designated parameter in thisRowSet
object's command with the given JavaObject
.void
Sets the value of the designated parameter with the given object.void
Sets the value of the designated parameter with the given object.void
Sets the value of the designated parameter with the given object.void
setPassword
(String password) Sets the database password for thisRowSet
object to the givenString
.void
setQueryTimeout
(int seconds) Sets the maximum time the driver will wait for a statement to execute to the given number of seconds.void
setReadOnly
(boolean value) Sets whether thisRowSet
object is read-only to the givenboolean
.void
Sets the designated parameter in thisRowSet
object's command with the givenRef
value.void
Sets the designated parameter to the givenjava.sql.RowId
object.void
Sets the designated parameter to the givenjava.sql.RowId
object.void
setShort
(int parameterIndex, short x) Sets the designated parameter in thisRowSet
object's command to the given Javashort
value.void
Sets the designated parameter to the given Javashort
value.void
Sets the designated parameter to the givenjava.sql.SQLXML
object.void
Sets the designated parameter to the givenjava.sql.SQLXML
object.void
Sets the designated parameter in thisRowSet
object's command to the given JavaString
value.void
Sets the designated parameter to the given JavaString
value.void
Sets the designated parameter in thisRowSet
object's command to the givenjava.sql.Time
value.void
Sets the designated parameter in thisRowSet
object's command with the givenjava.sql.Time
value.void
Sets the designated parameter to the givenjava.sql.Time
value.void
Sets the designated parameter to the givenjava.sql.Time
value, using the givenCalendar
object.void
setTimestamp
(int parameterIndex, Timestamp x) Sets the designated parameter in thisRowSet
object's command to the givenjava.sql.Timestamp
value.void
setTimestamp
(int parameterIndex, Timestamp x, Calendar cal) Sets the designated parameter in thisRowSet
object's command with the givenjava.sql.Timestamp
value.void
setTimestamp
(String parameterName, Timestamp x) Sets the designated parameter to the givenjava.sql.Timestamp
value.void
setTimestamp
(String parameterName, Timestamp x, Calendar cal) Sets the designated parameter to the givenjava.sql.Timestamp
value, using the givenCalendar
object.void
setTransactionIsolation
(int level) Sets the transaction isolation level for thisRowSet
object.void
setType
(int type) Sets the type of thisRowSet
object to the given type.void
setTypeMap
(Map<String, Class<?>> map) Installs the givenjava.util.Map
object as the default type map for thisRowSet
object.void
Sets the URL thisRowSet
object will use when it uses theDriverManager
to create a connection.void
Sets the designated parameter to the givenjava.net.URL
value.void
setUsername
(String name) Sets the username property for thisRowSet
object to the givenString
.Methods declared in interface Wrapper
isWrapperFor, unwrap
Modifier and TypeMethodDescriptionboolean
isWrapperFor
(Class<?> iface) Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does.<T> T
Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy.
-
Method Details
-
getShowDeleted
Retrieves aboolean
indicating whether rows marked for deletion appear in the set of current rows. Iftrue
is returned, deleted rows are visible with the current rows. Iffalse
is returned, rows are not visible with the set of current rows. The default value isfalse
.Standard rowset implementations may choose to restrict this behavior for security considerations or for certain deployment scenarios. The visibility of deleted rows is implementation-defined and does not represent standard behavior.
Note: Allowing deleted rows to remain visible complicates the behavior of some standard JDBC
RowSet
implementations methods. However, most rowset users can simply ignore this extra detail because only very specialized applications will likely want to take advantage of this feature.- Returns:
true
if deleted rows are visible;false
otherwise- Throws:
SQLException
- if a rowset implementation is unable to to determine whether rows marked for deletion remain visible- See Also:
-
setShowDeleted
Sets the propertyshowDeleted
to the givenboolean
value. This property determines whether rows marked for deletion continue to appear in the set of current rows. If the value is set totrue
, deleted rows are immediately visible with the set of current rows. If the value is set tofalse
, the deleted rows are set as invisible with the current set of rows.Standard rowset implementations may choose to restrict this behavior for security considerations or for certain deployment scenarios. This is left as implementation-defined and does not represent standard behavior.
- Parameters:
b
-true
if deleted rows should be shown;false
otherwise- Throws:
SQLException
- if a rowset implementation is unable to to reset whether deleted rows should be visible- See Also:
-
getRowSetWarnings
Retrieves the first warning reported by calls on thisJdbcRowSet
object. If a second warning was reported on thisJdbcRowSet
object, it will be chained to the first warning and can be retrieved by calling the methodRowSetWarning.getNextWarning
on the first warning. Subsequent warnings on thisJdbcRowSet
object will be chained to theRowSetWarning
objects returned by the methodRowSetWarning.getNextWarning
. The warning chain is automatically cleared each time a new row is read. This method may not be called on aRowSet
object that has been closed; doing so will cause anSQLException
to be thrown.Because it is always connected to its data source, a
JdbcRowSet
object can rely on the presence of activeStatement
,Connection
, andResultSet
instances. This means that applications can obtain additionalSQLWarning
notifications by calling thegetNextWarning
methods that they provide. DisconnectedRowset
objects, such as aCachedRowSet
object, do not have access to thesegetNextWarning
methods.- Returns:
- the first
RowSetWarning
object reported on thisJdbcRowSet
object ornull
if there are none - Throws:
SQLException
- if this method is called on a closedJdbcRowSet
object- See Also:
-
commit
EachJdbcRowSet
contains aConnection
object from theResultSet
or JDBC properties passed to it's constructors. This method wraps theConnection
commit method to allow flexible auto commit or non auto commit transactional control support.Makes all changes made since the previous commit/rollback permanent and releases any database locks currently held by this Connection object. This method should be used only when auto-commit mode has been disabled.
- Throws:
SQLException
- if a database access error occurs or this Connection object within thisJdbcRowSet
is in auto-commit mode- See Also:
-
getAutoCommit
EachJdbcRowSet
contains aConnection
object from the originalResultSet
or JDBC properties passed to it. This method wraps theConnection
'sgetAutoCommit
method to allow an application to determine theJdbcRowSet
transaction behavior.Sets this connection's auto-commit mode to the given state. If a connection is in auto-commit mode, then all its SQL statements will be executed and committed as individual transactions. Otherwise, its SQL statements are grouped into transactions that are terminated by a call to either the method commit or the method rollback. By default, new connections are in auto-commit mode.
- Returns:
true
if auto-commit is enabled;false
otherwise- Throws:
SQLException
- if a database access error occurs- See Also:
-
setAutoCommit
EachJdbcRowSet
contains aConnection
object from the originalResultSet
or JDBC properties passed to it. This method wraps theConnection
'sgetAutoCommit
method to allow an application to set theJdbcRowSet
transaction behavior.Sets the current auto-commit mode for this
Connection
object.- Parameters:
autoCommit
-true
to enable auto-commit;false
to disable auto-commit- Throws:
SQLException
- if a database access error occurs- See Also:
-
rollback
EachJdbcRowSet
contains aConnection
object from the originalResultSet
or JDBC properties passed to it. Undoes all changes made in the current transaction and releases any database locks currently held by thisConnection
object. This method should be used only when auto-commit mode has been disabled.- Throws:
SQLException
- if a database access error occurs or thisConnection
object within thisJdbcRowSet
is in auto-commit mode.- See Also:
-
rollback
EachJdbcRowSet
contains aConnection
object from the originalResultSet
or JDBC properties passed to it. Undoes all changes made in the current transaction to the last set savepoint and releases any database locks currently held by thisConnection
object. This method should be used only when auto-commit mode has been disabled.- Parameters:
s
- TheSavepoint
to rollback to- Throws:
SQLException
- if a database access error occurs or thisConnection
object within thisJdbcRowSet
is in auto-commit mode.- See Also:
-
getBigDecimal(int columnIndex)
orgetBigDecimal(String columnLabel)