0N/A<!
DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
0N/A <
meta http-
equiv="Content-Type" 0N/ACopyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. 2362N/ADO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/AThis code is free software; you can redistribute it and/or modify it 0N/Aunder the terms of the GNU General Public License version 2 only, as 0N/Apublished by the Free Software Foundation. Oracle designates this 0N/Aparticular file as subject to the "Classpath" exception as provided 0N/Aby Oracle in the LICENSE file that accompanied this code. 0N/AThis code is distributed in the hope that it will be useful, but WITHOUT 0N/AANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/AFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/Aversion 2 for more details (a copy is included in the LICENSE file that 2362N/AYou should have received a copy of the GNU General Public License version 0N/A2 along with this work; if not, write to the Free Software Foundation, 0N/AInc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/APlease contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A <
body bgcolor="#ffffff">
0N/A<!-- Description clause --> 0N/AStandard interfaces and base classes for JDBC <
code>RowSet</
code>
0N/Aimplementations. This package contains interfaces and classes
0N/Athat a standard <
code>RowSet</
code> implementation either implements or extends.
0N/A<
h2>Table of Contents</
h2>
0N/A<
li><
a href="#pkgspec">1.0 Package Specification</
a>
0N/A<
li><
a href="#stdrowset">2.0 Standard RowSet Definitions</
a>
0N/A<
li><
a href="#impl">3.0 Implementater's Guide</
a>
0N/A<
li><
a href="#relspec">4.0 Related Specifications</
a>
0N/A<
li><
a href="#reldocs">5.0 Related Documentation</
a>
0N/A<
h3><
a name="pkgspec">1.0 Package Specification</
a></
h3>
0N/AThis package specifies five standard JDBC <
code>RowSet</
code> interfaces.
0N/Aspecification. It is anticipated that additional definitions
0N/Aof more specialized JDBC <
code>RowSet</
code> types will emerge as this technology
0N/Amatures. Future definitions <
i>should</
i> be specified as subinterfaces using
0N/Ainheritance similar to the way it is used in this specification.
0N/A<
i>Note:</
i> The interface definitions provided in this package form the basis for
0N/Aall compliant JDBC <
code>RowSet</
code> implementations. Vendors and more advanced
0N/Adevelopers who intend to provide their own compliant <
code>RowSet</
code> implementations
0N/Ashould pay particular attention to the assertions detailed in specification
0N/A<
h3><
a name="stdrowset">2.0 Standard RowSet Definitions</
a></
h3>
0N/Aa <
tt>ResultSet</
tt> object that makes it possible to use the result set as a
0N/AJavaBeans<
sup><
font size=-
2>TM</
font></
sup> component. Thus,
0N/Aa <
tt>JdbcRowSet</
tt> object can be a Bean that any tool
0N/Amakes available for assembling an application as part of a component based
0N/Aarchitecture . A <
tt>JdbcRowSet</
tt> object is a connected <
code>RowSet</
code>
0N/A<
b>must</
b> continually maintain its connection to its data source using a JDBC
0N/Atechnology-enabled driver ("JDBC driver"). In addition, a <
code>JdbcRowSet</
code>
0N/Aobject provides a fully updatable and scrollable tabular
0N/Adata structure as defined in the JDBC 3.0 specification.
0N/A<
b><
code>CachedRowSet</
code><
sup><
font size=-
2>TM></
font></
sup</b></
a>
0N/A - A <
tt>CachedRowSet</
tt> object is a JavaBeans<
sup><
font size=-
2>TM</
font></
sup>
0N/A component that is scrollable, updatable, serializable, and generally disconnected from
0N/A the source of its data. A <
tt>CachedRowSet</
tt> object
0N/Atypically contains rows from a result set, but it can also contain rows from any
0N/Afile with a tabular format, such as a spreadsheet. <
tt>CachedRowSet</
tt> implementations
0N/A<
b>must</
b> use the <
tt>SyncFactory</
tt> to manage and obtain pluggable
0N/A<
code>SyncProvider</
code> objects to provide synchronization between the
0N/Adisconnected <
code>RowSet</
code> object and the originating data source.
0N/ATypically a <
code>SyncProvider</
code> implementation relies upon a JDBC
0N/Adriver to obtain connectivity to a particular data source.
0N/AFurther details on this mechanism are discussed in the <
a 0N/A<
code>WebRowSet</
code> object is an extension of <
tt>CachedRowSet</
tt>
0N/Athat can read and write a <
code>RowSet</
code> object in a well formed XML format.
0N/Ainterface) to read a rowset in XML format. It calls an
0N/Ato write a rowset in XML format. The reader and writer required by
0N/A<
code>WebRowSet</
code> objects are provided by the
0N/A<
code>SyncFactory</
code> in the form of <
code>SyncProvider</
code>
0N/Aimplementations. In order to ensure well formed XML usage, a standard generic XML
0N/ASchema is defined and published at
<
tt>FilteredRowSet</
tt> object provides filtering functionality in a programmatic
and extensible way. There are many instances when a <
tt>RowSet</
tt> <
code>object</
code>
has a need to provide filtering in its contents without sacrificing the disconnected
environment, thus saving the expense of having to create a connection to the data source.
Solutions to this need vary from providing heavyweight full scale
SQL query abilities, to portable components, to more lightweight
approaches. A <
code>FilteredRowSet</
code> object consumes
an implementation of the <
a href="Predicate.html"><
code>Predicate</
code></
a>
interface, which <
b>may</
b> define a filter at run time. In turn, a
<
code>FilteredRowSet</
code> object is tasked with enforcing the set filter for both
inbound and outbound read and write operations. That is, all filters can be
considered as bi-directional. No standard filters are defined;
however, sufficient mechanics are specified to permit any required filter to be
<
li><
a href="JoinRowSet.html"><
b><
code>JoinRowSet</
code></
b></
a> - The <
tt>JoinRowSet</
tt>
interface describes a mechanism by which relationships can be established between
two or more standard <
code>RowSet</
code> implementations. Any number of <
tt>RowSet</
tt>
objects can be added to a <
tt>JoinRowSet</
tt> object provided the <
tt>RowSet</
tt>objects
can be related in a SQL <
tt>JOIN</
tt> like fashion. By definition, the SQL <
tt>JOIN</
tt>
statement is used to combine the data contained in two (<
i>or more</
i>) relational
database tables based upon a common attribute. By establishing and then enforcing
column matches, a <
tt>JoinRowSet</
tt> object establishes relationships between
<
tt>RowSet</
tt> instances without the need to touch the originating data source.
<
h3><
a name="impl">3.0 Implementer's Guide</
a></
h3>
Compliant implementations of JDBC <
code>RowSet</
code> Implementations
<
b>must</
b> follow the assertions described in this specification. In accordance
Test Compatibility Kit (TCK) can be licensed to ensure compatibility with the
specification. The following paragraphs outline a number of starting points for
implementers of the standard JDBC <
code>RowSet</
code> definitions. Implementers
should also consult the <
i>Implementer's Guide</
i> in the <
a<
li><
b>3.1 Role of the <
code>BaseRowSet</
code> Class</
b>
A compliant JDBC <
code>RowSet</
code> implementation <
b>must</
b> implement one or more
standard interfaces specified in this package and and <
b>may</
b> extend the
<
a href="BaseRowSet.html"><
code>BaseRowSet</
code></
a> abstract class. For example, a
<
code>CachedRowSet</
code> implementation must implement the <
code>CachedRowSet</
code>
interface and extend the <
code>BaseRowSet</
code> abstract class. The
<
code>BaseRowSet</
code> class provides the standard architecture on which all
<
code>RowSet</
code> implementations should be built, regardless of whether the
<
code>RowSet</
code> objects exist in a connected or disconnected environment.
The <
tt>BaseRowSet</
tt> abstract class provides any <
tt>RowSet</
tt> implementation
with its base functionality, including property manipulation and event notification
component requirements. As an example, all implementations provided in the
reference implementations (contained in the <
tt>
com.sun.rowset</
tt> package) use
the <
tt>BaseRowSet</
tt> class as a basis for their implementations.
The following table illustrates the features that the <
code>BaseRowSet</
code>
<
table cellpadding="2" cellspacing="2" border="1" width="75%">
<
td valign="top"><
b>Feature</
b><
br>
<
td valign="top"><
b>Details</
b><
br>
<
td valign="top">Properties<
br>
<
td valign="top">Provides standard JavaBeans property manipulation
mechanisms to allow applications to get and set <
code>RowSet</
code> command and
property values. Refer to the documentation of the <
tt>
javax.
sql.
RowSet</
tt>
interface (available in the JDBC 3.0 specification) for more details on
the standard <
code>RowSet</
code> properties.<
br>
<
td valign="top">Event notification<
br>
<
td valign="top">Provides standard JavaBeans event notifications
</
tt> interface (available in the JDBC 3.0 specification) for
more details on how to register and handle standard RowSet events generated
by compliant implementations.<
br>
<
td valign="top">Setters for a RowSet object's command<
br>
<
td valign="top">Provides a complete set of setter methods
for setting RowSet command parameters.<
br>
<
td valign="top">Streams<
br>
<
td valign="top">Provides fields for storing of stream instances
in addition to providing a set of constants for stream type designation.<
br>
<
li><
b>3.2 Connected RowSet Requirements</
b>
The <
code>JdbcRowSet</
code> describes a <
code>RowSet</
code> object that <
b>must</
b> always
be connected to the originating data source. Implementations of the <
code>JdbcRowSet</
code>
should ensure that this connection is provided solely by a JDBC driver.
Furthermore, <
code>RowSet</
code> objects that are implementations of the
<
code>JdbcRowSet</
code> interface and are therefore operating in a connected environment
do not use the <
code>SyncFactory</
code> to obtain a <
code>RowSetReader</
code> object
or a <
code>RowSetWriter</
code> object. They can safely rely on the JDBC driver to
supply their needs by virtue of the presence of an underlying updatable and scrollable
<
code>ResultSet</
code> implementation.
<
b>3.3 Disconnected RowSet Requirements</
b>
A disconnected <
code>RowSet</
code> object, such as a <
code>CachedRowSet</
code> object,
connection management to a <
code>SyncProvider</
code> object provided by the
<
code>SyncFactory</
code>. To ensure fully disconnected semantics, all
disconnected <
code>RowSet</
code> objects <
b>must</
b> ensure
that the original connection made to the data source to populate the <
code>RowSet</
code>
object is closed to permit the garbage collector to recover and release resources. The
<
code>SyncProvider</
code> object ensures that the critical JDBC properties are
maintained in order to re-establish a connection to the data source when a
synchronization is required. A disconnected <
code>RowSet</
code> object should
extraneous references remain on the <
code>Connection</
code> object.
<
li><
b>3.4 Role of RowSetMetaDataImpl</
b>
The <
code>RowsetMetaDataImpl</
code> class is a utility class that provides an implementation of the
method implementations for metadata for both connected and disconnected
<
code>RowSet</
code> objects. All implementations are free to use this standard
implementation but are not required to do so.
<
li><
b>3.5 RowSetWarning Class</
b>
The <
code>RowSetWarning</
code> class provides warnings that can be set
on <
code>RowSet</
code> implementations.
<
code>RowSetWarning</
code> objects are silently chained to the object whose method
caused the warning to be thrown. All <
code>RowSet</
code> implementations <
b>should</
b>
ensure that this chaining occurs if a warning is generated and also ensure that the
warnings are available via the <
code>getRowSetWarnings</
code> method defined in either
the <
code>JdbcRowSet</
code> interface or the <
code>CachedRowSet</
code> interface.
After a warning has been retrieved with one of the
<
code>getRowSetWarnings</
code> methods, the <
code>RowSetWarning</
code> method
<
code>getNextWarning</
code> can be called on it to retrieve any warnings that might
be chained on it. If a warning is returned, <
code>getNextWarning</
code> can be called
on it, and so on until there are no more warnings.
<
li><
b>3.6 The Joinable Interface</
b>
The <
code>Joinable</
code> interface provides both connected and disconnected
<
code>RowSet</
code> objects with the capability to be added to a
<
code>JoinRowSet</
code> object in an SQL <
code>JOIN</
code> operation.
A <
code>RowSet</
code> object that has implemented the <
code>Joinable</
code>
interface can set a match column, retrieve a match column, or unset a match column.
A <
code>JoinRowSet</
code> object can then use the <
code>RowSet</
code> object's
match column as a basis for adding the <
code>RowSet</
code> object.
<
h3><
a name="relspec">4.0 Related Specifications</
a></
h3>
<
h3><
a name="reldocs">5.0 Related Documentation</
a></
h3>