0N/A<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
0N/A<html>
0N/A<head>
0N/A
0N/A <meta http-equiv="Content-Type"
0N/A content="text/html; charset=iso-8859-1">
0N/A<!--
2740N/ACopyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
0N/ADO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A
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
2362N/Apublished by the Free Software Foundation. Oracle designates this
0N/Aparticular file as subject to the "Classpath" exception as provided
2362N/Aby Oracle in the LICENSE file that accompanied this code.
0N/A
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
0N/Aaccompanied this code).
0N/A
0N/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/A
2365N/APlease contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2365N/Aor visit www.oracle.com if you need additional information or have any
2365N/Aquestions.
0N/A
0N/A-->
0N/A <title>javax.sql.rowset Package</title>
0N/A</head>
0N/A <body bgcolor="#ffffff">
0N/A
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
0N/A
0N/A<h2>Table of Contents</h2>
0N/A<ul>
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</ul>
0N/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/A All five extend the
0N/A<a href="/RowSet.html">RowSet</a> interface described in the JDBC 3.0
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<p>
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/Ainterfaces.
0N/A
0N/A<h3><a name="stdrowset">2.0 Standard RowSet Definitions</a></h3>
0N/A<ul>
0N/A<li><a href="JdbcRowSet.html"><b><code>JdbcRowSet</code></b></a> - A wrapper around
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/Aobject, that is, it
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<p>
0N/A<li><a href="CachedRowSet.html">
2740N/A<b><code>CachedRowSet</code>&trade;</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/Ahref="spi/package-summary.html"><code>javax.sql.rowset.spi</code></a> package
0N/Aspecification.
0N/A<p>
0N/A<li><a href="WebRowSet.html"><b><code>WebRowSet</code></b></a> - 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/AThis class calls an <a href="spi/XmlReader.html"><code>XmlReader</code></a> object
0N/A(an extension of the <a href="/RowSetReader.html"><code>RowSetReader</code></a>
0N/Ainterface) to read a rowset in XML format. It calls an
0N/A<a href="spi/XmlWriter.html"><code>XmlWriter</code></a> object (an extension of the
0N/A<a href="/RowSetWriter.html"><code>RowSetWriter</code></a> interface)
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
0N/A<a href="http://java.sun.com/xml/ns/jdbc/webrowset.xsd">
0N/A<code>http://java.sun.com/xml/ns/jdbc/webrowset.xsd</code></a>.
0N/A<p>
0N/A<li><a href="FilteredRowSet.html"><b><code>FilteredRowSet</code></b></a> - A
0N/A<tt>FilteredRowSet</tt> object provides filtering functionality in a programmatic
0N/Aand extensible way. There are many instances when a <tt>RowSet</tt> <code>object</code>
0N/Ahas a need to provide filtering in its contents without sacrificing the disconnected
0N/Aenvironment, thus saving the expense of having to create a connection to the data source.
0N/ASolutions to this need vary from providing heavyweight full scale
0N/ASQL query abilities, to portable components, to more lightweight
0N/Aapproaches. A <code>FilteredRowSet</code> object consumes
0N/Aan implementation of the <a href="Predicate.html"><code>Predicate</code></a>
0N/Ainterface, which <b>may</b> define a filter at run time. In turn, a
0N/A<code>FilteredRowSet</code> object is tasked with enforcing the set filter for both
0N/Ainbound and outbound read and write operations. That is, all filters can be
0N/Aconsidered as bi-directional. No standard filters are defined;
0N/Ahowever, sufficient mechanics are specified to permit any required filter to be
0N/Aimplemented.
0N/A<p>
0N/A<li><a href="JoinRowSet.html"><b><code>JoinRowSet</code></b></a> - The <tt>JoinRowSet</tt>
0N/Ainterface describes a mechanism by which relationships can be established between
0N/Atwo or more standard <code>RowSet</code> implementations. Any number of <tt>RowSet</tt>
0N/A objects can be added to a <tt>JoinRowSet</tt> object provided the <tt>RowSet</tt>objects
0N/Acan be related in a SQL <tt>JOIN</tt> like fashion. By definition, the SQL <tt>JOIN</tt>
0N/Astatement is used to combine the data contained in two (<i>or more</i>) relational
0N/Adatabase tables based upon a common attribute. By establishing and then enforcing
0N/Acolumn matches, a <tt>JoinRowSet</tt> object establishes relationships between
0N/A<tt>RowSet</tt> instances without the need to touch the originating data source.
0N/A</ul>
0N/A
0N/A<h3><a name="impl">3.0 Implementer's Guide</a></h3>
0N/ACompliant implementations of JDBC <code>RowSet</code> Implementations
0N/A<b>must</b> follow the assertions described in this specification. In accordance
0N/Awith the terms of the <a href="http://www.jcp.org">Java Community Process</a>, a
0N/ATest Compatibility Kit (TCK) can be licensed to ensure compatibility with the
0N/Aspecification. The following paragraphs outline a number of starting points for
0N/Aimplementers of the standard JDBC <code>RowSet</code> definitions. Implementers
0N/Ashould also consult the <i>Implementer's Guide</i> in the <a
0N/Ahref="spi/package-summary.html">javax.sql.rowset.spi</a> package for guidelines
0N/Aon <a href="spi/SyncProvider.html"><code>SyncProvider</code></a> implementations.
0N/A<p>
0N/A<ul>
2740N/A<li><b>3.1 Constructor</b>
2740N/A<p>
2740N/A All <code>RowSet</code> implementations <strong>must</strong> provide a
2740N/Ano-argument constructor.
2740N/A</li>
2740N/A<li><b>3.2 Role of the <code>BaseRowSet</code> Class</b>
0N/A<p>
0N/AA compliant JDBC <code>RowSet</code> implementation <b>must</b> implement one or more
0N/Astandard interfaces specified in this package and and <b>may</b> extend the
0N/A<a href="BaseRowSet.html"><code>BaseRowSet</code></a> abstract class. For example, a
0N/A<code>CachedRowSet</code> implementation must implement the <code>CachedRowSet</code>
0N/Ainterface and extend the <code>BaseRowSet</code> abstract class. The
0N/A<code>BaseRowSet</code> class provides the standard architecture on which all
0N/A<code>RowSet</code> implementations should be built, regardless of whether the
0N/A<code>RowSet</code> objects exist in a connected or disconnected environment.
0N/AThe <tt>BaseRowSet</tt> abstract class provides any <tt>RowSet</tt> implementation
0N/Awith its base functionality, including property manipulation and event notification
0N/Athat is fully compliant with <a href="http://java.sun.com/products/javabeans">JavaBeans</a>
0N/Acomponent requirements. As an example, all implementations provided in the
0N/Areference implementations (contained in the <tt>com.sun.rowset</tt> package) use
0N/Athe <tt>BaseRowSet</tt> class as a basis for their implementations.
0N/A<P>
0N/AThe following table illustrates the features that the <code>BaseRowSet</code>
0N/Aabstract class provides.
0N/A <blockquote>
0N/A <table cellpadding="2" cellspacing="2" border="1" width="75%">
0N/A <tbody>
0N/A <tr>
0N/A <td valign="top"><b>Feature</b><br>
0N/A </td>
0N/A <td valign="top"><b>Details</b><br>
0N/A </td>
0N/A </tr>
0N/A <tr>
0N/A <td valign="top">Properties<br>
0N/A </td>
0N/A <td valign="top">Provides standard JavaBeans property manipulation
0N/A mechanisms to allow applications to get and set <code>RowSet</code> command and
0N/Aproperty values. Refer to the documentation of the <tt>javax.sql.RowSet</tt>
0N/Ainterface (available in the JDBC 3.0 specification) for more details on
0N/Athe standard <code>RowSet</code> properties.<br>
0N/A </td>
0N/A </tr>
0N/A <tr>
0N/A <td valign="top">Event notification<br>
0N/A </td>
0N/A <td valign="top">Provides standard JavaBeans event notifications
0N/A to registered event listeners. Refer to the documentation of <tt>javax.sql.RowSetEvent
0N/A </tt> interface (available in the JDBC 3.0 specification) for
0N/Amore details on how to register and handle standard RowSet events generated
0N/Aby compliant implementations.<br>
0N/A </td>
0N/A </tr>
0N/A <tr>
0N/A <td valign="top">Setters for a RowSet object's command<br>
0N/A </td>
0N/A <td valign="top">Provides a complete set of setter methods
0N/A for setting RowSet command parameters.<br>
0N/A </td>
0N/A </tr>
0N/A <tr>
0N/A <td valign="top">Streams<br>
0N/A </td>
0N/A <td valign="top">Provides fields for storing of stream instances
0N/A in addition to providing a set of constants for stream type designation.<br>
0N/A </td>
0N/A </tr>
0N/A
0N/A </tbody>
0N/A </table>
0N/A </blockquote>
0N/A<p>
2740N/A<li><b>3.3 Connected RowSet Requirements</b>
0N/A<p>
0N/AThe <code>JdbcRowSet</code> describes a <code>RowSet</code> object that <b>must</b> always
0N/Abe connected to the originating data source. Implementations of the <code>JdbcRowSet</code>
0N/Ashould ensure that this connection is provided solely by a JDBC driver.
0N/AFurthermore, <code>RowSet</code> objects that are implementations of the
0N/A<code>JdbcRowSet</code> interface and are therefore operating in a connected environment
0N/Ado not use the <code>SyncFactory</code> to obtain a <code>RowSetReader</code> object
0N/Aor a <code>RowSetWriter</code> object. They can safely rely on the JDBC driver to
0N/Asupply their needs by virtue of the presence of an underlying updatable and scrollable
0N/A<code>ResultSet</code> implementation.
0N/A<p>
0N/A
0N/A<li>
2740N/A<b>3.4 Disconnected RowSet Requirements</b>
0N/A<p>
0N/AA disconnected <code>RowSet</code> object, such as a <code>CachedRowSet</code> object,
0N/A<b>should</b> delegate
0N/Aconnection management to a <code>SyncProvider</code> object provided by the
0N/A<code>SyncFactory</code>. To ensure fully disconnected semantics, all
0N/Adisconnected <code>RowSet</code> objects <b>must</b> ensure
0N/Athat the original connection made to the data source to populate the <code>RowSet</code>
0N/Aobject is closed to permit the garbage collector to recover and release resources. The
0N/A<code>SyncProvider</code> object ensures that the critical JDBC properties are
0N/Amaintained in order to re-establish a connection to the data source when a
0N/Asynchronization is required. A disconnected <code>RowSet</code> object should
0N/Atherefore ensure that no
0N/Aextraneous references remain on the <code>Connection</code> object.
0N/A<p>
2740N/A<li><b>3.5 Role of RowSetMetaDataImpl</b>
0N/A<p>
0N/AThe <code>RowsetMetaDataImpl</code> class is a utility class that provides an implementation of the
0N/A<a href="/RowSetMetaData.html">RowSetMetaData</a> interface, supplying standard setter
0N/Amethod implementations for metadata for both connected and disconnected
0N/A<code>RowSet</code> objects. All implementations are free to use this standard
0N/Aimplementation but are not required to do so.
0N/A<p>
2740N/A<li><b>3.6 RowSetWarning Class</b>
0N/A<p>
0N/AThe <code>RowSetWarning</code> class provides warnings that can be set
0N/Aon <code>RowSet</code> implementations.
0N/ASimilar to <a href="/java/sql/SQLWarning.html">SQLWarning</a> objects,
0N/A<code>RowSetWarning</code> objects are silently chained to the object whose method
0N/Acaused the warning to be thrown. All <code>RowSet</code> implementations <b>should</b>
0N/Aensure that this chaining occurs if a warning is generated and also ensure that the
0N/Awarnings are available via the <code>getRowSetWarnings</code> method defined in either
0N/Athe <code>JdbcRowSet</code> interface or the <code>CachedRowSet</code> interface.
0N/AAfter a warning has been retrieved with one of the
0N/A<code>getRowSetWarnings</code> methods, the <code>RowSetWarning</code> method
0N/A<code>getNextWarning</code> can be called on it to retrieve any warnings that might
0N/Abe chained on it. If a warning is returned, <code>getNextWarning</code> can be called
0N/Aon it, and so on until there are no more warnings.
0N/A
0N/A
0N/A<P>
2740N/A<li><b>3.7 The Joinable Interface</b>
0N/A<P>
0N/AThe <code>Joinable</code> interface provides both connected and disconnected
0N/A<code>RowSet</code> objects with the capability to be added to a
0N/A<code>JoinRowSet</code> object in an SQL <code>JOIN</code> operation.
0N/AA <code>RowSet</code> object that has implemented the <code>Joinable</code>
0N/Ainterface can set a match column, retrieve a match column, or unset a match column.
0N/AA <code>JoinRowSet</code> object can then use the <code>RowSet</code> object's
2740N/Amatch column as a basis for adding the <code>RowSet</code> object.
2740N/A</li>
2740N/A
2740N/A<li><b>3.8 The RowSetFactory Interface</b>
2740N/A <p>
2740N/A A <code>RowSetFactory</code> implementation <strong>must</strong>
2740N/A be provided.
2740N/A</li>
0N/A</ul>
0N/A
0N/A<h3><a name="relspec">4.0 Related Specifications</a></h3>
0N/A<ul>
0N/A<li><a href="http://java.sun.com/products/jdbc">JDBC 3.0 Specification</a>
0N/A<li><a href="http://www.w3.org/XML/Schema">XML Schema</a>
0N/A<li><a href="http://www.syncml.org">SyncML</a>
0N/A</ul>
0N/A
0N/A<h3><a name="reldocs">5.0 Related Documentation</a></h3>
0N/A<ul>
3910N/A<li><a href="http://java.sun.com/developer/Books/JDBCTutorial/chapter5.html">
0N/AJDBC RowSet Tutorial</a>
0N/A</ul>
0N/A</body>
0N/A</html>