public interface RowSet extends ResultSet
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.
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 Type | Method and Description |
---|---|
void |
addRowSetListener(RowSetListener listener)
Registers the given listener so that it will be notified of events
that occur on this
RowSet object. |
void |
clearParameters()
Clears the parameters set for this
RowSet object's command. |
void |
execute()
Fills this
RowSet object with data. |
String |
getCommand()
Retrieves this
RowSet object's command property. |
String |
getDataSourceName()
Retrieves the logical name that identifies the data source for this
RowSet object. |
boolean |
getEscapeProcessing()
Retrieves whether escape processing is enabled for this
RowSet object. |
int |
getMaxFieldSize()
Retrieves the maximum number of bytes that may be returned
for certain column values.
|
int |
getMaxRows()
Retrieves the maximum number of rows that this
RowSet
object can contain. |
String |
getPassword()
Retrieves the password used to create a database connection.
|
int |
getQueryTimeout()
Retrieves the maximum number of seconds the driver will wait for
a statement to execute.
|
int |
getTransactionIsolation()
Retrieves the transaction isolation level set for this
RowSet object. |
Map<String,Class<?>> |
getTypeMap()
Retrieves the
Map object associated with this
RowSet object, which specifies the custom mapping
of SQL user-defined types, if any. |
String |
getUrl()
Retrieves the url property this
RowSet object will use to
create a connection if it uses the DriverManager
instead of a DataSource object to establish the connection. |
String |
getUsername()
Retrieves the username used to create a database connection for this
RowSet object. |
boolean |
isReadOnly()
Retrieves whether this
RowSet 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 this
RowSet object. |
void |
setArray(int i,
Array x)
Sets the designated parameter in this
RowSet object's command
with the given Array value. |
void |
setAsciiStream(int parameterIndex,
InputStream x)
Sets the designated parameter in this
RowSet object's command
to the given input stream. |
void |
setAsciiStream(int parameterIndex,
InputStream x,
int length)
Sets the designated parameter in this
RowSet object's command
to the given java.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 this
RowSet object's command
to the given java.math.BigDeciaml value. |
void |
setBigDecimal(String parameterName,
BigDecimal x)
Sets the designated parameter to the given
java.math.BigDecimal value. |
void |
setBinaryStream(int parameterIndex,
InputStream x)
Sets the designated parameter in this
RowSet object's command
to the given input stream. |
void |
setBinaryStream(int parameterIndex,
InputStream x,
int length)
Sets the designated parameter in this
RowSet object's command
to the given java.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 i,
Blob x)
Sets the designated parameter in this
RowSet object's command
with the given Blob value. |
void |
setBlob(int parameterIndex,
InputStream inputStream)
Sets the designated parameter to a
InputStream object. |
void |
setBlob(int parameterIndex,
InputStream inputStream,
long length)
Sets the designated parameter to a
InputStream object. |
void |
setBlob(String parameterName,
Blob x)
Sets the designated parameter to the given
java.sql.Blob object. |
void |
setBlob(String parameterName,
InputStream inputStream)
Sets the designated parameter to a
InputStream object. |
void |
setBlob(String parameterName,
InputStream inputStream,
long length)
Sets the designated parameter to a
InputStream object. |
void |
setBoolean(int parameterIndex,
boolean x)
Sets the designated parameter in this
RowSet object's command
to the given Java boolean value. |
void |
setBoolean(String parameterName,
boolean x)
Sets the designated parameter to the given Java
boolean value. |
void |
setByte(int parameterIndex,
byte x)
Sets the designated parameter in this
RowSet object's command
to the given Java byte value. |
void |
setByte(String parameterName,
byte x)
Sets the designated parameter to the given Java
byte value. |
void |
setBytes(int parameterIndex,
byte[] x)
Sets the designated parameter in this
RowSet object's command
to the given Java array of byte values. |
void |
setBytes(String parameterName,
byte[] x)
Sets the designated parameter to the given Java array of bytes.
|
void |
setCharacterStream(int parameterIndex,
Reader reader)
Sets the designated parameter in this
RowSet object's command
to the given Reader
object. |
void |
setCharacterStream(int parameterIndex,
Reader reader,
int length)
Sets the designated parameter in this
RowSet object's command
to the given java.io.Reader value. |
void |
setCharacterStream(String parameterName,
Reader reader)
Sets the designated parameter to the given
Reader
object. |
void |
setCharacterStream(String parameterName,
Reader reader,
int length)
Sets the designated parameter to the given
Reader
object, which is the given number of characters long. |
void |
setClob(int i,
Clob x)
Sets the designated parameter in this
RowSet object's command
with the given Clob value. |
void |
setClob(int parameterIndex,
Reader reader)
Sets the designated parameter to a
Reader object. |
void |
setClob(int parameterIndex,
Reader reader,
long length)
Sets the designated parameter to a
Reader object. |
void |
setClob(String parameterName,
Clob x)
Sets the designated parameter to the given
java.sql.Clob object. |
void |
setClob(String parameterName,
Reader reader)
Sets the designated parameter to a
Reader object. |
void |
setClob(String parameterName,
Reader reader,
long length)
Sets the designated parameter to a
Reader object. |
void |
setCommand(String cmd)
Sets this
RowSet object's command property to the given
SQL query. |
void |
setConcurrency(int concurrency)
Sets the concurrency of this
RowSet object to the given
concurrency level. |
void |
setDataSourceName(String name)
Sets the data source name property for this
RowSet object to the
given String . |
void |
setDate(int parameterIndex,
Date x)
Sets the designated parameter in this
RowSet object's command
to the given java.sql.Date value. |
void |
setDate(int parameterIndex,
Date x,
Calendar cal)
Sets the designated parameter in this
RowSet object's command
with the given java.sql.Date value. |
void |
setDate(String parameterName,
Date x)
Sets the designated parameter to the given
java.sql.Date value
using the default time zone of the virtual machine that is running
the application. |
void |
setDate(String parameterName,
Date x,
Calendar cal)
Sets the designated parameter to the given
java.sql.Date value,
using the given Calendar object. |
void |
setDouble(int parameterIndex,
double x)
Sets the designated parameter in this
RowSet object's command
to the given Java double value. |
void |
setDouble(String parameterName,
double x)
Sets the designated parameter to the given Java
double value. |
void |
setEscapeProcessing(boolean enable)
Sets escape processing for this
RowSet object on or
off. |
void |
setFloat(int parameterIndex,
float x)
Sets the designated parameter in this
RowSet object's command
to the given Java float value. |
void |
setFloat(String parameterName,
float x)
Sets the designated parameter to the given Java
float value. |
void |
setInt(int parameterIndex,
int x)
Sets the designated parameter in this
RowSet object's command
to the given Java int value. |
void |
setInt(String parameterName,
int x)
Sets the designated parameter to the given Java
int value. |
void |
setLong(int parameterIndex,
long x)
Sets the designated parameter in this
RowSet object's command
to the given Java long value. |
void |
setLong(String parameterName,
long x)
Sets the designated parameter to the given Java
long 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 this
RowSet
object can contain to the specified number. |
void |
setNCharacterStream(int parameterIndex,
Reader value)
Sets the designated parameter in this
RowSet object's command
to a Reader object. |
void |
setNCharacterStream(int parameterIndex,
Reader value,
long length)
Sets the designated parameter to a
Reader object. |
void |
setNCharacterStream(String parameterName,
Reader value)
Sets the designated parameter to a
Reader object. |
void |
setNCharacterStream(String parameterName,
Reader value,
long length)
Sets the designated parameter to a
Reader object. |
void |
setNClob(int parameterIndex,
NClob value)
Sets the designated parameter to a
java.sql.NClob object. |
void |
setNClob(int parameterIndex,
Reader reader)
Sets the designated parameter to a
Reader object. |
void |
setNClob(int parameterIndex,
Reader reader,
long length)
Sets the designated parameter to a
Reader object. |
void |
setNClob(String parameterName,
|