The RowSet
interface provides a set of JavaBeans properties that allow a RowSet
instance to be configured to connect to a JDBC data source and read
some data from the data source. A group of setter methods (setInt,
setBytes, setString, and so on)
provide a way to pass input parameters to a rowset's command property.
This command is the SQL query the rowset uses when it gets its data from
a relational database, which is generally the case.
The RowSet
interface supports JavaBeans events, allowing other components in an
application to be notified when an event occurs on a rowset,
such as a change in its value.
The RowSet interface is unique in that it is intended to be
implemented using the rest of the JDBC API. In other words, a
RowSet implementation is a layer of software that executes "on top"
of a JDBC driver. Implementations of the RowSet interface can
be provided by anyone, including JDBC driver vendors who want to
provide a RowSet implementation as part of their JDBC products.
A RowSet object may make a connection with a data source and
maintain that connection throughout its life cycle, in which case it is
called a connected rowset. A rowset may also make a connection with
a data source, get data from it, and then close the connection. Such a rowset
is called a disconnected rowset. A disconnected rowset may make
changes to its data while it is disconnected and then send the changes back
to the original source of the data, but it must reestablish a connection to do so.
A disconnected rowset may have a Reader (a RowSetReader object)
and a writer (a RowSetWriter object) associated with it.
The Reader may be implemented in many different ways to populate a rowset
with data, including getting data from a non-relational data source. The
writer can also be implemented in many different ways to propagate changes
made to the rowset's data back to the underlying data source.
Rowsets are easy to use. The RowSet interface extends the standard
java.sql.ResultSet interface. The RowSetMetaData
interface extends the java.sql.ResultSetMetaData interface.
Thus, developers familiar
with the JDBC API will have to learn a minimal number of new APIs to
use rowsets. In addition, third-party software tools that work with
JDBC ResultSet objects will also easily be made to work with rowsets.
| Modifier and Type | Method and Description |
|---|---|
| public void | addRowSetListener(RowSetListener
a component that has implemented the listener)RowSetListener
interface and wants to be notified when events occur on this
RowSet objectRegisters the given listener so that it will be notified of events
that occur on this |
| public void | |
| public void | |
| public String | Returns: the command string; may benullRetrieves this |
| public String | Returns: a data source nameRetrieves the logical name that identifies the data source for this
|
| public boolean | Returns: true if escape processing is enabled;
false if it is disabledRetrieves whether escape processing is enabled for this
|
| public int | Returns: the current maximum column size limit; zero means that there is no limitRetrieves the maximum number of bytes that may be returned for certain column values. |
| public int | Returns: the current maximum number of rows that thisRowSet
object can contain; zero means unlimitedRetrieves the maximum number of rows that this |
| public String | Returns: the password for making a database connectionRetrieves the password used to create a database connection. |
| public int | Returns: the current query timeout limit in seconds; zero means unlimitedRetrieves the maximum number of seconds the driver will wait for a statement to execute. |
| public int | Returns: the transaction isolation level; one ofConnection.TRANSACTION_READ_UNCOMMITTED,
Connection.TRANSACTION_READ_COMMITTED,
Connection.TRANSACTION_REPEATABLE_READ, or
Connection.TRANSACTION_SERIALIZABLERetrieves the transaction isolation level set for this
|
| public Map | Returns: ajava.util.Map object containing the names of
SQL user-defined types and the Java classes to which they are
to be mappedRetrieves the |
| public String | Returns: a string urlRetrieves the url property this |
| public String | Returns: the username propertyRetrieves the username used to create a database connection for this
|
| public boolean | Returns: true if this RowSet object is
read-only; false if it is updatableRetrieves whether this |
| public void | removeRowSetListener(RowSetListener
a component that has been registered as a listener for this
listener)RowSet objectRemoves the specified listener from the list of components that will be
notified when an event occurs on this |
| public void | |
| public void | setAsciiStream(int
the first parameter is 1, the second is 2, ... parameterIndex, InputStream the Java input stream that contains the ASCII parameter value x, int the number of bytes in the stream length)Sets the designated parameter in this |
| public void | setAsciiStream(String
the name of the parameter parameterName, InputStream the Java input stream that contains the ASCII parameter value x, int the number of bytes in the stream length)Sets the designated parameter to the given input stream, which will have the specified number of bytes. |
| public void | setAsciiStream(int
the first parameter is 1, the second is 2, ... parameterIndex, InputStream the Java input stream that contains the ASCII parameter value x)Sets the designated parameter in this |
| public void | setAsciiStream(String
the name of the parameter parameterName, InputStream the Java input stream that contains the ASCII parameter value x)Sets the designated parameter to the given input stream. |
| public void | setBigDecimal(int
the first parameter is 1, the second is 2, ... parameterIndex, BigDecimal the parameter value x)Sets the designated parameter in this |
| public void | setBigDecimal(String
the name of the parameter parameterName, BigDecimal the parameter value x)Sets the designated parameter to the given
|
| public void | setBinaryStream(int
the first parameter is 1, the second is 2, ... parameterIndex, InputStream the java input stream which contains the binary parameter value x, int the number of bytes in the stream length)Sets the designated parameter in this |
| public void | setBinaryStream(String
the name of the parameter parameterName, InputStream the java input stream which contains the binary parameter value x, int the number of bytes in the stream length)Sets the designated parameter to the given input stream, which will have the specified number of bytes. |
| public void | setBinaryStream(int
the first parameter is 1, the second is 2, ... parameterIndex, InputStream the java input stream which contains the binary parameter value x)Sets the designated parameter in this |
| public void | setBinaryStream(String
the name of the parameter parameterName, InputStream the java input stream which contains the binary parameter value x)Sets the designated parameter to the given input stream. |
| public void | |
| public void | setBlob(int
index of the first parameter is 1,
the second is 2, ... parameterIndex, InputStream An object that contains the data to set the parameter
value to. inputStream, long the number of bytes in the parameter data. length)Sets the designated parameter to a |
| public void | setBlob(int
index of the first parameter is 1,
the second is 2, ... parameterIndex, InputStream An object that contains the data to set the parameter
value to. inputStream)Sets the designated parameter to a |
| public void | setBlob(String
the name of the parameter to be set
the second is 2, ... parameterName, InputStream An object that contains the data to set the parameter
value to. inputStream, long the number of bytes in the parameter data. length)Sets the designated parameter to a |
| public void | |
| public void | setBlob(String
the name of the parameter parameterName, InputStream An object that contains the data to set the parameter
value to. inputStream)Sets the designated parameter to a |
| public void | setBoolean(int
the first parameter is 1, the second is 2, ... parameterIndex, boolean the parameter value x)Sets the designated parameter in this |
| public void | setBoolean(String
the name of the parameter parameterName, boolean the parameter value x)Sets the designated parameter to the given Java |
| public void | setByte(int
the first parameter is 1, the second is 2, ... parameterIndex, byte the parameter value x)Sets the designated parameter in this |
| public void | |
| public void | setBytes(int
the first parameter is 1, the second is 2, ... parameterIndex, byte[] the parameter value x)Sets the designated parameter in this |
| public void | |
| public void | setCharacterStream(int
the first parameter is 1, the second is 2, ... parameterIndex, Reader the reader, int Reader object that contains the UNICODE data
to be setthe number of characters in the stream length)Sets the designated parameter in this |
| public void | setCharacterStream(String
the name of the parameter parameterName, Reader the reader, int java.io.Reader object that
contains the UNICODE data used as the designated parameterthe number of characters in the stream length)Sets the designated parameter to the given |
| public void | setCharacterStream(int
the first parameter is 1, the second is 2, ... parameterIndex, Reader the reader)java.io.Reader object that contains the
Unicode dataSets the designated parameter in this |
| public void | setCharacterStream(String
the name of the parameter parameterName, Reader the reader)java.io.Reader object that contains the
Unicode dataSets the designated parameter to the given |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | setCommand(String
the SQL query that will be used to get the data for this
cmd)RowSet object; may be nullSets this |
| public void | setConcurrency(int
one of the concurrency)ResultSet constants specifying a
concurrency level: ResultSet.CONCUR_READ_ONLY or
ResultSet.CONCUR_UPDATABLESets the concurrency of this |
| public void | setDataSourceName(String
the logical name of the data source for this name)RowSet
object; may be nullSets the data source name property for this |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | setDouble(int
the first parameter is 1, the second is 2, ... parameterIndex, double the parameter value x)Sets the designated parameter in this |
| public void | |
| public void | setEscapeProcessing(boolean
true to enable escape processing;
false to disable itSets escape processing for this |
| public void | setFloat(int
the first parameter is 1, the second is 2, ... parameterIndex, float the parameter value x)Sets the designated parameter in this |
| public void | |
| public void | setInt(int
the first parameter is 1, the second is 2, ... parameterIndex, int the parameter value x)Sets the designated parameter in this |
| public void | |
| public void | setLong(int
the first parameter is 1, the second is 2, ... parameterIndex, long the parameter value x)Sets the designated parameter in this |
| public void | |
| public void | setMaxFieldSize(int
the new max column size limit in bytes; zero means unlimited max)Sets the maximum number of bytes that can be returned for a column value to the given number of bytes. |
| public void | setMaxRows(int
the new maximum number of rows; zero means unlimited max)Sets the maximum number of rows that this |
| public void | setNCharacterStream(int
of the first parameter is 1, the second is 2, ... parameterIndex, Reader the parameter value value)Sets the designated parameter in this |
| public void | setNCharacterStream(int
of the first parameter is 1, the second is 2, ... parameterIndex, Reader the parameter value value, long the number of characters in the parameter data. length)Sets the designated parameter to a |
| public void | setNCharacterStream(String
the name of the column to be set parameterName, Reader the parameter value value, long the number of characters in the parameter data. length)Sets the designated parameter to a |
| public void | setNCharacterStream(String
the name of the parameter parameterName, Reader the parameter value value)Sets the designated parameter to a |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | setNString(int
of the first parameter is 1, the second is 2, ... parameterIndex, String the parameter value value)Sets the designated parameter to the given |
| public void | setNString(String
the name of the column to be set parameterName, String the parameter value value)Sets the designated parameter to the given |
| public void | setNull(int
the first parameter is 1, the second is 2, ... parameterIndex, int a SQL type code defined by sqlType)java.sql.TypesSets the designated parameter in this |
| public void | |
| public void | setNull(int
the first parameter is 1, the second is 2, ... paramIndex, int a value from sqlType, String java.sql.Typesthe fully qualified name of an SQL UDT or the type
name of the SQL structured type being referenced by a typeName)REF
type; ignored if the parameter is not a UDT or REF typeSets the designated parameter in this |
| public void | |
| public void | setObject(int
the first parameter is 1, the second is 2, ... parameterIndex, Object the object containing the input parameter value x, int the SQL type (as defined in targetSqlType, int java.sql.Types)
to be sent to the database. The scale argument may further qualify this
type.for scaleOrLength)java.sql.Types.DECIMAL
or java.sql.Types.NUMERIC types,
this is the number of digits after the decimal point. For
Java Object types InputStream and Reader,
this is the length
of the data in the stream or Reader. For all other types,
this value will be ignored.Sets the designated parameter in this |
| public void | setObject(String
the name of the parameter parameterName, Object the object containing the input parameter value x, int the SQL type (as defined in java.sql.Types) to be
sent to the database. The scale argument may further qualify this type. targetSqlType, int for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types,
this is the number of digits after the decimal point. For all other
types, this value will be ignored. scale)Sets the value of the designated parameter with the given object. |
| public void | setObject(int
the first parameter is 1, the second is 2, ... parameterIndex, Object the object containing the input parameter value x, int the SQL type (as defined in targetSqlType)java.sql.Types)
to be sent to the databaseSets the designated parameter in this |
| public void | |
| public void | |
| public void | |
| public void | setPassword(String
the password string password)Sets the database password for this |
| public void | setQueryTimeout(int
the new query timeout limit in seconds; zero means
that there is no limit seconds)Sets the maximum time the driver will wait for a statement to execute to the given number of seconds. |
| public void | setReadOnly(boolean
true if read-only; false if
updatableSets whether this |
| public void | |
| public void | |
| public void | |
| public void | setShort(int
the first parameter is 1, the second is 2, ... parameterIndex, short the parameter value x)Sets the designated parameter in this |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | setTimestamp(int
the first parameter is 1, the second is 2, ... parameterIndex, Timestamp the parameter value x)Sets the designated parameter in this |
| public void | setTimestamp(String
the name of the parameter parameterName, Timestamp the parameter value x)Sets the designated parameter to the given |
| public void | setTimestamp(int
the first parameter is 1, the second is 2, ... parameterIndex, Timestamp the parameter value x, Calendar the cal)java.util.Calendar object to use for calculating the
timestampSets the designated parameter in this |
| public void | setTimestamp(String
the name of the parameter parameterName, Timestamp the parameter value x, Calendar the cal)Calendar object the driver will use
to construct the timestampSets the designated parameter to the given |
| public void | setTransactionIsolation(int
the transaction isolation level; one of
level)Connection.TRANSACTION_READ_UNCOMMITTED,
Connection.TRANSACTION_READ_COMMITTED,
Connection.TRANSACTION_REPEATABLE_READ, or
Connection.TRANSACTION_SERIALIZABLESets the transaction isolation level for this |
| public void | setType(int
one of the type)ResultSet constants specifying a type:
ResultSet.TYPE_FORWARD_ONLY,
ResultSet.TYPE_SCROLL_INSENSITIVE, or
ResultSet.TYPE_SCROLL_SENSITIVESets the type of this |
| public void | setTypeMap(Map<String, Class<?>>
a map)java.util.Map object containing the names of
SQL user-defined types and the Java classes to which they are
to be mappedInstalls the given |
| public void | |
| public void | |
| public void | setUsername(String
a user name name)Sets the username property for this |