Java Reference
In-Depth Information
with the added feature that it adds JavaBeans support to the JDBC API. Similarly, the
RowSetMetaData interface extends the ResultSetMetaData interface.
Being JavaBeans, RowSets follow the JavaBeans model for setting and getting
properties and for event notification, so they are easy to combine with other
components in an application.
RowSets make it easy to send tabular data over a network. They can also be used as
a wrapper, providing scrollable result sets or updatable result sets when the
underlying JDBC driver does not support them.
There are two main types of RowSets: connected and disconnected.
 
A connected RowSet, like a ResultSet, maintains a connection to a data source for as long as the
RowSet is in use.
 
A disconnected RowSet gets a connection to a data source to load data or to propagate changes
back to the data source, but most of the time it does not have a connection open.
While it is disconnected, a RowSet does not need a JDBC driver or the full JDBC API,
so its footprint is very small.
Because it is not continually connected to its data source, a disconnected RowSet
stores its data in memory. It maintains MetaData about the columns it contains and
information about its internal state. It also includes methods for making connections,
executing commands, and reading and writing data to and from the data source.
Implementations of RowSets include the following:
 
JDBCRowSet — A connected RowSet that serves mainly as a thin wrapper around a ResultSet
object to make a JDBC driver look like a JavaBeans component
 
CachedRowSet — A disconnected RowSet that caches its data in memory
 
WebRowSet — A connected RowSet that uses the HTTP protocol internally to talk to a Java
servlet that provides data access
Creating a Rowset and Setting Properties
Since RowSets are JavaBeans, they contain setter and getter methods for retrieving
and setting properties.
These methods include the following:
 
setCommand — The SQL command to be executed
 
setConcurrency — Read only or updatable
 
setType — Scrollable or foward only
 
setDataSourceName — Used with DataSource access
Search WWH ::




Custom Search