package.html revision 0
1821N/A<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
1821N/A<html>
5526N/A<head>
1821N/A
1821N/A <meta http-equiv="Content-Type"
1821N/A content="text/html; charset=iso-8859-1">
1821N/A<!--
2362N/ACopyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved.
1821N/ADO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2362N/A
1821N/AThis code is free software; you can redistribute it and/or modify it
1821N/Aunder the terms of the GNU General Public License version 2 only, as
1821N/Apublished by the Free Software Foundation. Sun designates this
1821N/Aparticular file as subject to the "Classpath" exception as provided
1821N/Aby Sun in the LICENSE file that accompanied this code.
1821N/A
1821N/AThis code is distributed in the hope that it will be useful, but WITHOUT
1821N/AANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1821N/AFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1821N/Aversion 2 for more details (a copy is included in the LICENSE file that
1821N/Aaccompanied this code).
2362N/A
2362N/AYou should have received a copy of the GNU General Public License version
2362N/A2 along with this work; if not, write to the Free Software Foundation,
1821N/AInc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1821N/A
1821N/APlease contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
1821N/ACA 95054 USA or visit www.sun.com if you need additional information or
1821N/Ahave any questions.
1821N/A
1821N/A-->
1821N/A <title>javax.sql.rowset Package</title>
1821N/A</head>
1821N/A <body bgcolor="#ffffff">
1821N/A
1821N/A<!-- Description clause -->
1821N/AStandard interfaces and base classes for JDBC <code>RowSet</code>
1821N/Aimplementations. This package contains interfaces and classes
1821N/Athat a standard <code>RowSet</code> implementation either implements or extends.
1821N/A
1821N/A
1821N/A<h2>Table of Contents</h2>
1821N/A<ul>
3589N/A<li><a href="#pkgspec">1.0 Package Specification</a>
1821N/A<li><a href="#stdrowset">2.0 Standard RowSet Definitions</a>
4632N/A<li><a href="#impl">3.0 Implementater's Guide</a>
4632N/A<li><a href="#relspec">4.0 Related Specifications</a>
4632N/A<li><a href="#reldocs">5.0 Related Documentation</a>
4632N/A</ul>
4632N/A
3589N/A<h3><a name="pkgspec">1.0 Package Specification</a></h3>
1821N/AThis package specifies five standard JDBC <code>RowSet</code> interfaces.
1821N/A All five extend the
1821N/A<a href="/RowSet.html">RowSet</a> interface described in the JDBC 3.0
1821N/Aspecification. It is anticipated that additional definitions
1821N/Aof more specialized JDBC <code>RowSet</code> types will emerge as this technology
1821N/Amatures. Future definitions <i>should</i> be specified as subinterfaces using
1821N/Ainheritance similar to the way it is used in this specification.
1821N/A<p>
1821N/A<i>Note:</i> The interface definitions provided in this package form the basis for
1821N/Aall compliant JDBC <code>RowSet</code> implementations. Vendors and more advanced
1821N/Adevelopers who intend to provide their own compliant <code>RowSet</code> implementations
1821N/Ashould pay particular attention to the assertions detailed in specification
1821N/Ainterfaces.
1821N/A
1821N/A<h3><a name="stdrowset">2.0 Standard RowSet Definitions</a></h3>
1821N/A<ul>
1821N/A<li><a href="JdbcRowSet.html"><b><code>JdbcRowSet</code></b></a> - A wrapper around
1821N/Aa <tt>ResultSet</tt> object that makes it possible to use the result set as a
1821N/AJavaBeans<sup><font size=-2>TM</font></sup> component. Thus,
1821N/Aa <tt>JdbcRowSet</tt> object can be a Bean that any tool
1821N/Amakes available for assembling an application as part of a component based
1821N/Aarchitecture . A <tt>JdbcRowSet</tt> object is a connected <code>RowSet</code>
1821N/Aobject, that is, it
1821N/A<b>must</b> continually maintain its connection to its data source using a JDBC
1821N/Atechnology-enabled driver ("JDBC driver"). In addition, a <code>JdbcRowSet</code>
1821N/Aobject provides a fully updatable and scrollable tabular
1821N/Adata structure as defined in the JDBC 3.0 specification.
1821N/A<p>
1821N/A<li><a href="CachedRowSet.html">
1821N/A<b><code>CachedRowSet</code><sup><font size=-2>TM></font></sup</b></a>
1821N/A - A <tt>CachedRowSet</tt> object is a JavaBeans<sup><font size=-2>TM</font></sup>
1821N/A component that is scrollable, updatable, serializable, and generally disconnected from
1821N/A the source of its data. A <tt>CachedRowSet</tt> object
1821N/Atypically contains rows from a result set, but it can also contain rows from any
1821N/Afile with a tabular format, such as a spreadsheet. <tt>CachedRowSet</tt> implementations
1821N/A<b>must</b> use the <tt>SyncFactory</tt> to manage and obtain pluggable
1821N/A<code>SyncProvider</code> objects to provide synchronization between the
1821N/Adisconnected <code>RowSet</code> object and the originating data source.
1821N/ATypically a <code>SyncProvider</code> implementation relies upon a JDBC
1821N/Adriver to obtain connectivity to a particular data source.
1821N/AFurther details on this mechanism are discussed in the <a
1821N/Ahref="spi/package-summary.html"><code>javax.sql.rowset.spi</code></a> package
1821N/Aspecification.
1821N/A<p>
1821N/A<li><a href="WebRowSet.html"><b><code>WebRowSet</code></b></a> - A
1821N/A<code>WebRowSet</code> object is an extension of <tt>CachedRowSet</tt>
1821N/Athat can read and write a <code>RowSet</code> object in a well formed XML format.
1821N/AThis class calls an <a href="spi/XmlReader.html"><code>XmlReader</code></a> object
1821N/A(an extension of the <a href="/RowSetReader.html"><code>RowSetReader</code></a>
1821N/Ainterface) to read a rowset in XML format. It calls an
1821N/A<a href="spi/XmlWriter.html"><code>XmlWriter</code></a> object (an extension of the
1821N/A<a href="/RowSetWriter.html"><code>RowSetWriter</code></a> interface)
1821N/Ato write a rowset in XML format. The reader and writer required by
1821N/A<code>WebRowSet</code> objects are provided by the
1821N/A<code>SyncFactory</code> in the form of <code>SyncProvider</code>
1821N/Aimplementations. In order to ensure well formed XML usage, a standard generic XML
1821N/ASchema is defined and published at
1821N/A<a href="http://java.sun.com/xml/ns/jdbc/webrowset.xsd">
1821N/A<code>http://java.sun.com/xml/ns/jdbc/webrowset.xsd</code></a>.
1821N/A<p>
1821N/A<li><a href="FilteredRowSet.html"><b><code>FilteredRowSet</code></b></a> - A
1821N/A<tt>FilteredRowSet</tt> object provides filtering functionality in a programmatic
1821N/Aand extensible way. There are many instances when a <tt>RowSet</tt> <code>object</code>
1821N/Ahas a need to provide filtering in its contents without sacrificing the disconnected
1821N/Aenvironment, thus saving the expense of having to create a connection to the data source.
1821N/ASolutions to this need vary from providing heavyweight full scale
1821N/ASQL query abilities, to portable components, to more lightweight
1821N/Aapproaches. A <code>FilteredRowSet</code> object consumes
1821N/Aan implementation of the <a href="Predicate.html"><code>Predicate</code></a>
1821N/Ainterface, which <b>may</b> define a filter at run time. In turn, a
1821N/A<code>FilteredRowSet</code> object is tasked with enforcing the set filter for both
1821N/Ainbound and outbound read and write operations. That is, all filters can be
1821N/Aconsidered as bi-directional. No standard filters are defined;
4595N/Ahowever, sufficient mechanics are specified to permit any required filter to be
4595N/Aimplemented.
4595N/A<p>
1821N/A<li><a href="JoinRowSet.html"><b><code>JoinRowSet</code></b></a> - The <tt>JoinRowSet</tt>
4632N/Ainterface describes a mechanism by which relationships can be established between
1821N/Atwo or more standard <code>RowSet</code> implementations. Any number of <tt>RowSet</tt>
1821N/A objects can be added to a <tt>JoinRowSet</tt> object provided the <tt>RowSet</tt>objects
4632N/Acan be related in a SQL <tt>JOIN</tt> like fashion. By definition, the SQL <tt>JOIN</tt>
1821N/Astatement is used to combine the data contained in two (<i>or more</i>) relational
1821N/Adatabase tables based upon a common attribute. By establishing and then enforcing
4632N/Acolumn matches, a <tt>JoinRowSet</tt> object establishes relationships between
1821N/A<tt>RowSet</tt> instances without the need to touch the originating data source.
1821N/A</ul>
4632N/A
1821N/A<h3><a name="impl">3.0 Implementer's Guide</a></h3>
4847N/ACompliant implementations of JDBC <code>RowSet</code> Implementations
4847N/A<b>must</b> follow the assertions described in this specification. In accordance
4847N/Awith the terms of the <a href="http://www.jcp.org">Java Community Process</a>, a
1821N/ATest Compatibility Kit (TCK) can be licensed to ensure compatibility with the
1821N/Aspecification. The following paragraphs outline a number of starting points for
1821N/Aimplementers of the standard JDBC <code>RowSet</code> definitions. Implementers
1821N/Ashould also consult the <i>Implementer's Guide</i> in the <a
2402N/Ahref="spi/package-summary.html">javax.sql.rowset.spi</a> package for guidelines
4632N/Aon <a href="spi/SyncProvider.html"><code>SyncProvider</code></a> implementations.
2402N/A<p>
5526N/A<ul>
5526N/A<li><b>3.1 Role of the <code>BaseRowSet</code> Class</b>
5526N/A<p>
5526N/AA compliant JDBC <code>RowSet</code> implementation <b>must</b> implement one or more
5526N/Astandard interfaces specified in this package and and <b>may</b> extend the
5526N/A<a href="BaseRowSet.html"><code>BaseRowSet</code></a> abstract class. For example, a
5526N/A<code>CachedRowSet</code> implementation must implement the <code>CachedRowSet</code>
5526N/Ainterface and extend the <code>BaseRowSet</code> abstract class. The
5526N/A<code>BaseRowSet</code> class provides the standard architecture on which all
5526N/A<code>RowSet</code> implementations should be built, regardless of whether the
5526N/A<code>RowSet</code> objects exist in a connected or disconnected environment.
5526N/AThe <tt>BaseRowSet</tt> abstract class provides any <tt>RowSet</tt> implementation
5526N/Awith its base functionality, including property manipulation and event notification
5526N/Athat is fully compliant with <a href="http://java.sun.com/products/javabeans">JavaBeans</a>
5526N/Acomponent requirements. As an example, all implementations provided in the
5526N/Areference implementations (contained in the <tt>com.sun.rowset</tt> package) use
5526N/Athe <tt>BaseRowSet</tt> class as a basis for their implementations.
5526N/A<P>
5526N/AThe following table illustrates the features that the <code>BaseRowSet</code>
5526N/Aabstract class provides.
5526N/A <blockquote>
5526N/A <table cellpadding="2" cellspacing="2" border="1" width="75%">
5526N/A <tbody>
5526N/A <tr>
5526N/A <td valign="top"><b>Feature</b><br>
5526N/A </td>
5526N/A <td valign="top"><b>Details</b><br>
5526N/A </td>
5526N/A </tr>
5526N/A <tr>
5526N/A <td valign="top">Properties<br>
5526N/A </td>
2203N/A <td valign="top">Provides standard JavaBeans property manipulation
4632N/A mechanisms to allow applications to get and set <code>RowSet</code> command and
2203N/Aproperty values. Refer to the documentation of the <tt>javax.sql.RowSet</tt>
2017N/Ainterface (available in the JDBC 3.0 specification) for more details on
2017N/Athe standard <code>RowSet</code> properties.<br>
2017N/A </td>
2017N/A </tr>
2017N/A <tr>
1821N/A <td valign="top">Event notification<br>
4632N/A </td>
1821N/A <td valign="top">Provides standard JavaBeans event notifications
1821N/A to registered event listeners. Refer to the documentation of <tt>javax.sql.RowSetEvent
4632N/A </tt> interface (available in the JDBC 3.0 specification) for
1821N/Amore details on how to register and handle standard RowSet events generated
3589N/Aby compliant implementations.<br>
1821N/A </td>
1821N/A </tr>
1821N/A <tr>
4632N/A <td valign="top">Setters for a RowSet object's command<br>
1821N/A </td>
1821N/A <td valign="top">Provides a complete set of setter methods
4632N/A for setting RowSet command parameters.<br>
1821N/A </td>
1821N/A </tr>
1821N/A <tr>
1821N/A <td valign="top">Streams<br>
1821N/A </td>
1821N/A <td valign="top">Provides fields for storing of stream instances
1821N/A in addition to providing a set of constants for stream type designation.<br>
1821N/A </td>
4632N/A </tr>
1821N/A
1821N/A </tbody>
4632N/A </table>
1821N/A </blockquote>
1821N/A<p>
1821N/A<li><b>3.2 Connected RowSet Requirements</b>
4632N/A<p>
1821N/AThe <code>JdbcRowSet</code> describes a <code>RowSet</code> object that <b>must</b> always
1821N/Abe connected to the originating data source. Implementations of the <code>JdbcRowSet</code>
4632N/Ashould ensure that this connection is provided solely by a JDBC driver.
1821N/AFurthermore, <code>RowSet</code> objects that are implementations of the
1821N/A<code>JdbcRowSet</code> interface and are therefore operating in a connected environment
4632N/Ado not use the <code>SyncFactory</code> to obtain a <code>RowSetReader</code> object
1821N/Aor a <code>RowSetWriter</code> object. They can safely rely on the JDBC driver to
1821N/Asupply their needs by virtue of the presence of an underlying updatable and scrollable
1821N/A<code>ResultSet</code> implementation.
1821N/A<p>
1821N/A
1821N/A<li>
1821N/A<b>3.3 Disconnected RowSet Requirements</b>
5526N/A<p>
1821N/AA disconnected <code>RowSet</code> object, such as a <code>CachedRowSet</code> object,
4595N/A<b>should</b> delegate
4595N/Aconnection management to a <code>SyncProvider</code> object provided by the
4595N/A<code>SyncFactory</code>. To ensure fully disconnected semantics, all
5375N/Adisconnected <code>RowSet</code> objects <b>must</b> ensure
4632N/Athat the original connection made to the data source to populate the <code>RowSet</code>
1821N/Aobject is closed to permit the garbage collector to recover and release resources. The
4991N/A<code>SyncProvider</code> object ensures that the critical JDBC properties are
5375N/Amaintained in order to re-establish a connection to the data source when a
5375N/Asynchronization is required. A disconnected <code>RowSet</code> object should
5375N/Atherefore ensure that no
5375N/Aextraneous references remain on the <code>Connection</code> object.
5375N/A<p>
5375N/A<li><b>3.4 Role of RowSetMetaDataImpl</b>
5375N/A<p>
5375N/AThe <code>RowsetMetaDataImpl</code> class is a utility class that provides an implementation of the
5375N/A<a href="/RowSetMetaData.html">RowSetMetaData</a> interface, supplying standard setter
5375N/Amethod implementations for metadata for both connected and disconnected
5375N/A<code>RowSet</code> objects. All implementations are free to use this standard
5375N/Aimplementation but are not required to do so.
5375N/A<p>
5375N/A<li><b>3.5 RowSetWarning Class</b>
5375N/A<p>
5375N/AThe <code>RowSetWarning</code> class provides warnings that can be set
5375N/Aon <code>RowSet</code> implementations.
5375N/ASimilar to <a href="/java/sql/SQLWarning.html">SQLWarning</a> objects,
5375N/A<code>RowSetWarning</code> objects are silently chained to the object whose method
4991N/Acaused the warning to be thrown. All <code>RowSet</code> implementations <b>should</b>
1821N/Aensure that this chaining occurs if a warning is generated and also ensure that the
1821N/Awarnings are available via the <code>getRowSetWarnings</code> method defined in either
1821N/Athe <code>JdbcRowSet</code> interface or the <code>CachedRowSet</code> interface.
1821N/AAfter a warning has been retrieved with one of the
4812N/A<code>getRowSetWarnings</code> methods, the <code>RowSetWarning</code> method
4812N/A<code>getNextWarning</code> can be called on it to retrieve any warnings that might
4812N/Abe chained on it. If a warning is returned, <code>getNextWarning</code> can be called
4812N/Aon it, and so on until there are no more warnings.
4812N/A
4812N/A
4812N/A<P>
4812N/A<li><b>3.6 The Joinable Interface</b>
4812N/A<P>
4812N/AThe <code>Joinable</code> interface provides both connected and disconnected
4847N/A<code>RowSet</code> objects with the capability to be added to a
4847N/A<code>JoinRowSet</code> object in an SQL <code>JOIN</code> operation.
4847N/AA <code>RowSet</code> object that has implemented the <code>Joinable</code>
4847N/Ainterface can set a match column, retrieve a match column, or unset a match column.
4991N/AA <code>JoinRowSet</code> object can then use the <code>RowSet</code> object's
4991N/Amatch column as a basis for adding the <code>RowSet</code> object.
4991N/A</ul>
4991N/A
4991N/A<h3><a name="relspec">4.0 Related Specifications</a></h3>
4991N/A<ul>
4991N/A<li><a href="http://java.sun.com/products/jdbc">JDBC 3.0 Specification</a>
4991N/A<li><a href="http://www.w3.org/XML/Schema">XML Schema</a>
4991N/A<li><a href="http://www.syncml.org">SyncML</a>
4991N/A</ul>
4991N/A
4991N/A<h3><a name="reldocs">5.0 Related Documentation</a></h3>
4991N/A<ul>
4991N/A<li><a href="http://developer.java.sun.com/developer/Books/JDBCTutorial/chapter5.html">
4991N/AJDBC RowSet Tutorial</a>
4991N/A</ul>
4991N/A</body>
1821N/A</html>
1821N/A