uTools-Manuals/docs/java/javax/sql/rowset/package-summary.html

241 lines
19 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="header">
<h1 class="title" title="Package">Package javax.sql.rowset</h1>
<div class="docSummary">
<div class="block">
JDBC
<code>RowSet</code>实现的标准接口和基类。
</div>
</div>
<p>See: <a href="#package.description">描述</a></p>
</div><div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" class="typeSummary" summary="Interface Summary table, listing interfaces, and an explanation">
<caption>
<span>接口摘要</span>
<span class="tabEnd"> </span>
</caption>
<tbody>
<tr>
<th class="colFirst" scope="col">接口</th>
<th class="colLast" scope="col">描述</th>
</tr>
</tbody>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../javax/sql/rowset/CachedRowSet.html" title="interface in javax.sql.rowset">CachedRowSet</a></td>
<td class="colLast">
<div class="block">
CachedRowSet的所有标准
<code>CachedRowSet</code>必须实现的接口。
</div> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../javax/sql/rowset/FilteredRowSet.html" title="interface in javax.sql.rowset">FilteredRowSet</a></td>
<td class="colLast">
<div class="block">
FilteredRowSet的所有标准
<code>FilteredRowSet</code>必须实现的标准接口。
</div> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../javax/sql/rowset/JdbcRowSet.html" title="interface in javax.sql.rowset">JdbcRowSet</a></td>
<td class="colLast">
<div class="block">
JdbcRowSet的所有标准
<code>JdbcRowSet</code>必须实现的标准接口。
</div> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../javax/sql/rowset/Joinable.html" title="interface in javax.sql.rowset">Joinable</a></td>
<td class="colLast">
<div class="block">
1.0背景
</div> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../javax/sql/rowset/JoinRowSet.html" title="interface in javax.sql.rowset">JoinRowSet</a></td>
<td class="colLast">
<div class="block">
<code>JoinRowSet</code>接口提供了将来自不同
<code>RowSet</code>对象的相关数据
<code>RowSet</code>到一个
<code>JoinRowSet</code>对象中的机制该对象表示SQL
<code>JOIN</code>
</div> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../javax/sql/rowset/Predicate.html" title="interface in javax.sql.rowset">Predicate</a></td>
<td class="colLast">
<div class="block">
为所有
<code>FilteredRowSet</code>对象提供
<code>FilteredRowSet</code>来描述其过滤器的标准接口。
</div> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../javax/sql/rowset/RowSetFactory.html" title="interface in javax.sql.rowset">RowSetFactory</a></td>
<td class="colLast">
<div class="block">
一个定义工厂实现的接口,用于获取不同类型的
<code>RowSet</code>实现。
</div> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../javax/sql/rowset/WebRowSet.html" title="interface in javax.sql.rowset">WebRowSet</a></td>
<td class="colLast">
<div class="block">
WebRowSet的所有
<code>WebRowSet</code>必须实现的标准接口。
</div> </td>
</tr>
</tbody>
</table> </li>
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" class="typeSummary" summary="Class Summary table, listing classes, and an explanation">
<caption>
<span>类摘要</span>
<span class="tabEnd"> </span>
</caption>
<tbody>
<tr>
<th class="colFirst" scope="col"></th>
<th class="colLast" scope="col">描述</th>
</tr>
</tbody>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../javax/sql/rowset/BaseRowSet.html" title="class in javax.sql.rowset">BaseRowSet</a></td>
<td class="colLast">
<div class="block">
一个提供
<code>RowSet</code>对象及其基本功能的抽象类。
</div> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../javax/sql/rowset/RowSetMetaDataImpl.html" title="class in javax.sql.rowset">RowSetMetaDataImpl</a></td>
<td class="colLast">
<div class="block">
提供有关设置和获取关于
<code>RowSet</code>对象列的元数据信息的方法的实现。
</div> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../javax/sql/rowset/RowSetProvider.html" title="class in javax.sql.rowset">RowSetProvider</a></td>
<td class="colLast">
<div class="block">
工厂API使应用程序能够获得
<code>RowSetFactory</code>实现,可将用于产生不同类型的
<code>RowSet</code>实现。
</div> </td>
</tr>
</tbody>
</table> </li>
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" class="typeSummary" summary="Exception Summary table, listing exceptions, and an explanation">
<caption>
<span>异常摘要</span>
<span class="tabEnd"> </span>
</caption>
<tbody>
<tr>
<th class="colFirst" scope="col">异常</th>
<th class="colLast" scope="col">描述</th>
</tr>
</tbody>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../javax/sql/rowset/RowSetWarning.html" title="class in javax.sql.rowset">RowSetWarning</a></td>
<td class="colLast">
<div class="block">
SQLException的
<code>SQLException</code> ,提供有关在
<code>RowSet</code>对象上设置的数据库警告的信息。
</div> </td>
</tr>
</tbody>
</table> </li>
</ul>
<a name="package.description">
<!-- --> </a>
<h2 title="Package javax.sql.rowset Description">Package javax.sql.rowset Description</h2>
<div class="block">
<span>JDBC <code>RowSet</code>实现的标准接口和基类。</span>
<span>此包包含标准<code>RowSet</code>实现实现或扩展的接口和类。</span>
<h2> <span>目录</span> </h2>
<ul>
<li> <span><a href="#pkgspec">1.0 Package Specification</a></span> </li>
<li> <span><a href="#stdrowset">2.0 Standard RowSet Definitions</a></span> </li>
<li> <span><a href="#impl">3.0 Implementer's Guide</a></span> </li>
<li> <span><a href="#relspec">4.0 Related Specifications</a></span> </li>
<li> <span><a href="#reldocs">5.0 Related Documentation</a></span> </li>
</ul>
<h3> <span><a name="pkgspec">1.0 Package Specification</a></span> </h3>
<span>该包指定了五个标准的JDBC <code>RowSet</code>接口。</span>
<span>所有五个延长<a href="../RowSet.html">RowSet</a>在JDBC 3.0说明书中描述的接口。</span>
<span>随着这项技术的成熟预计将会出现更专门的JDBC <code>RowSet</code>类型的额外定义。</span>
<span>未来的定义<i>应该</i>使用与本规范中使用的方式类似的继承来指定为子接口。</span>
<p> <span><i>注意:</i>此包中提供的接口定义构成了所有兼容的JDBC <code>RowSet</code>实现的基础。</span> <span>要提供自己的兼容性<code>RowSet</code>实现的供应商和更多高级开发人员应特别注意规范界面中详细说明的断言。</span> </p>
<h3> <span><a name="stdrowset">2.0 Standard RowSet Definitions</a></span> </h3>
<ul>
<li> <span><a href="JdbcRowSet.html"><b><code>JdbcRowSet</code></b></a> - 围绕<tt>ResultSet</tt>对象的包装器可以将结果集用作JavaBeans的组件。</span> <span>因此, <tt>JdbcRowSet</tt>对象可以是一个Bean任何工具都可用于组合应用程序作为基于组件的架构的一部分。</span> <span>一个<tt>JdbcRowSet</tt>对象是连接的<code>RowSet</code>对象,也就是说,它<b>必须</b>使用支持JDBC技术的驱动程序“JDBC驱动程序”不断地保持与数据源的连接。</span> <span>此外, <code>JdbcRowSet</code>对象提供了一个完全可更新和可滚动的表格数据结构如JDBC 3.0规范中所定义。</span> <p></p></li>
<li> <span><a href="CachedRowSet.html"><b><code>CachedRowSet</code></b></a> - <tt>CachedRowSet</tt>对象是可滚动可更新可序列化的JavaBeans的组件并且通常与其数据源断开连接。</span> <span><tt>CachedRowSet</tt>对象通常包含结果集中的行,但它也可以包含任何具有表格格式的文件(如电子表格)的行。</span> <span><tt>CachedRowSet</tt>实现<b>必须</b>使用<tt>SyncFactory</tt>来管理和获取可插拔的<code>SyncProvider</code>对象,以提供断开的<code>RowSet</code>对象与始发数据源之间的同步。</span> <span>通常, <code>SyncProvider</code>实现依赖于JDBC驱动程序来获取与特定数据源的连接。</span> <span>有关此机制的更多详细信息,请参见<a href="spi/package-summary.html"><code>javax.sql.rowset.spi</code></a>包规范。</span> <p></p></li>
<li> <span><a href="WebRowSet.html"><b><code>WebRowSet</code></b></a> - <code>WebRowSet</code>对象是CachedRowSet的<tt>扩展</tt> 可以以良好格式的XML格式读写<code>RowSet</code>对象。</span> <span>此类调用<a href="spi/XmlReader.html"><code>XmlReader</code></a>对象(<code>RowSetReader</code>接口的<a href="../RowSetReader.html">扩展</a>以XML格式读取行集。</span> <span>它调用一个<a href="spi/XmlWriter.html"><code>XmlWriter</code></a>对象(<code>RowSetWriter</code>接口的<a href="../RowSetWriter.html">扩展</a>以XML格式写入行集。</span> <span>通过所需要的读取器和写入器<code>WebRowSet</code>目的是通过提供<code>SyncFactory</code>的形式<code>SyncProvider</code>实现。</span> <span>为了确保良好的XML使用一个标准的通用XML模式被定义并发布在<a href="http://java.sun.com/xml/ns/jdbc/webrowset.xsd"><code>http://java.sun.com/xml/ns/jdbc/webrowset.xsd</code></a></span> <p></p></li>
<li> <span><a href="FilteredRowSet.html"><b><code>FilteredRowSet</code></b></a> - <tt>FilteredRowSet</tt>对象以编程和可扩展的方式提供过滤功能。</span> <span>当一个<tt>RowSet</tt> <code>object</code>需要在其内容中提供过滤而不牺牲断开的环境时,有许多情况,从而节省了创建到数据源的连接的费用。</span> <span>这种需求的解决方案从提供重量级的全尺寸SQL查询能力到便携式组件到更轻量级的方法不同。</span> <span><code>FilteredRowSet</code>对象消耗了<code>Predicate</code> <a href="Predicate.html">接口的</a>实现, <b>可以</b>在运行时定义一个过滤器。</span> <span>反过来, <code>FilteredRowSet</code>对象的任务是强制执行入站和出站读写操作的设置过滤器。</span> <span>也就是说,所有的滤波器都可以被认为是双向的。</span> <span>没有定义标准过滤器;</span> <span>然而,指定足够的力学来允许实现任何所需的过滤器。</span> <p></p></li>
<li> <span><a href="JoinRowSet.html"><b><code>JoinRowSet</code></b></a> - <tt>JoinRowSet</tt>接口描述了两种或多种标准<code>RowSet</code>实现之间可以建立关系的机制。</span> <span>任何数量的<tt>RowSet</tt>对象都可以添加到一个<tt>JoinRowSet</tt>对象中,只要<tt>RowSet</tt>对象可以与SQL <tt>JOIN</tt>相似。</span> <span>根据定义SQL <tt>JOIN</tt>语句用于根据公共属性组合包含在两个( <i>或多个</i> )关系数据库表中的数据。</span> <span>通过建立并执行列匹配, <tt>JoinRowSet</tt>对象在RowSet实例之间<tt>建立</tt>关系,而无需触摸始发数据源。</span> </li>
</ul>
<h3> <span><a name="impl">3.0 Implementer's Guide</a></span> </h3>
<span>JDBC <code>RowSet</code>实现<b>必须</b>遵循本规范中描述的断言。</span>
<span>根据条款<a href="http://www.jcp.org">Java Community Process</a> 测试兼容性套件TCK可以被授权以确保与规范的兼容性。</span>
<span>以下段落概述了标准JDBC <code>RowSet</code>定义的实现者的<code>RowSet</code>起点。</span>
<span>实施者还应参考<a href="spi/package-summary.html">javax.sql.rowset.spi</a>软件包中的“ <a href="spi/package-summary.html">实施者</a> <i>指南”</i> <a href="spi/package-summary.html">了解</a>有关<code>SyncProvider</code>实现的<a href="spi/SyncProvider.html">指导</a>原则。</span>
<p></p>
<ul>
<li> <span><b>3.1构造函数</b></span> <p> <span>所有<code>RowSet</code>实现<strong>都必须</strong>提供无参数的构造函数。</span> </p></li>
<li> <span><b>3.2 <code>BaseRowSet</code>类的作用</b></span> <p> <span>符合JDBC <code>RowSet</code>实现<b>必须</b>实现此包中指定的一个或多个标准接口, <b>并可</b>扩展<a href="BaseRowSet.html"><code>BaseRowSet</code></a>抽象类。</span> <span>例如, <code>CachedRowSet</code>实现必须实现<code>CachedRowSet</code>接口并扩展<code>BaseRowSet</code>抽象类。</span> <span><code>BaseRowSet</code>类提供了构建所有<code>RowSet</code>实现的标准架构,无论<code>RowSet</code>对象是否存在于连接或断开连接的环境中。</span> <span><tt>BaseRowSet</tt>抽象类提供其基本功能的任何<tt>RowSet</tt>实现,包括完全符合<a href="http://java.sun.com/products/javabeans">JavaBeans</a>组件要求的属性操作和事件通知。</span> <span>作为示例,参考实现(包含在<tt>com.sun.rowset</tt>包中)中提供的所有实现使用<tt>BaseRowSet</tt>类作为其实现的基础。</span> </p><p> <span>下表说明了<code>BaseRowSet</code>抽象类提供的功能。</span> </p>
<blockquote>
<span>
<table border="1" cellpadding="2" cellspacing="2" width="75%">
<tbody>
<tr>
<td valign="top"><b>Feature</b><br/> </td>
<td valign="top"><b>Details</b><br/> </td>
</tr>
<tr>
<td valign="top">Properties<br/> </td>
<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>
</tr>
<tr>
<td valign="top">Event notification<br/> </td>
<td valign="top">Provides standard JavaBeans event notifications to registered event listeners. Refer to the documentation of <tt>javax.sql.RowSetEvent </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>
</tr>
<tr>
<td valign="top">Setters for a RowSet object's command<br/> </td>
<td valign="top">Provides a complete set of setter methods for setting RowSet command parameters.<br/> </td>
</tr>
<tr>
<td valign="top">Streams<br/> </td>
<td valign="top">Provides fields for storing of stream instances in addition to providing a set of constants for stream type designation.<br/> </td>
</tr>
</tbody>
</table></span>
</blockquote><p></p></li>
<li> <span><b>3.3连接的RowSet要求</b></span> <p> <span><code>JdbcRowSet</code>描述了<b>必须</b>始终连接到始发数据源的<code>RowSet</code>对象。</span> <span>JdbcRowSet的<code>JdbcRowSet</code>应该确保此连接仅由JDBC驱动程序提供。</span> <span>此外, <code>RowSet</code>对象属于的实现<code>JdbcRowSet</code>接口和在连接的环境中运行,因此不使用<code>SyncFactory</code>以获得<code>RowSetReader</code>对象或<code>RowSetWriter</code>对象。</span> <span>借助于底层可更新和可滚动的<code>ResultSet</code>实现他们可以安全地依靠JDBC驱动程序提供他们的需求。</span> </p><p></p></li>
<li> <span><b>3.4断开RowSet要求</b></span> <p> <span>断开连接的<code>RowSet</code>对象,如<code>CachedRowSet</code>对象, <b>应该</b>委托连接管理到<code>SyncProvider</code>由所提供的对象<code>SyncFactory</code></span> <span>为了确保完全断开连接的语义,所有断开连接的<code>RowSet</code>对象<b>必须</b>确保关闭数据源的原始连接以填充<code>RowSet</code>对象,以允许垃圾收集器恢复和释放资源。</span> <span><code>SyncProvider</code>对象确保了维护关键的JDBC属性以便在需要同步时重新建立与数据源的连接。</span> <span>断开连接的<code>RowSet</code>因此对象应确保没有多余的引用保持在<code>Connection</code>对象。</span> </p><p></p></li>
<li> <span><b>3.5 RowSetMetaDataImpl的作用</b></span> <p> <span><code>RowsetMetaDataImpl</code>类是一个实用程序类它提供RowSetMetaData <a href="../RowSetMetaData.html">接口的</a>实现,为连接和断开的<code>RowSet</code>对象的元数据提供标准的setter方法实现。</span> <span>所有实现都可以自由使用此标准实现,但不需要这样做。</span> </p><p></p></li>
<li> <span><b>3.6 RowSetWarning类</b></span> <p> <span><code>RowSetWarning</code>类提供可在<code>RowSet</code>实现上设置的警告。</span> <span>类似于<a href="../../../java/sql/SQLWarning.html">SQLWarning</a>对象, <code>RowSetWarning</code>对象被静默链接到方法引发警告的对象。</span> <span>所有<code>RowSet</code>实施<b></b>确保在生成警告时发生此链接,并确保通过<code>JdbcRowSet</code>界面或<code>CachedRowSet</code>界面中定义的<code>getRowSetWarnings</code>方法确保警告可用。</span> <span>在使用<code>getRowSetWarnings</code>方法检索到警告后,可以调用<code>RowSetWarning</code>方法<code>getNextWarning</code>以检索可能链接的任何警告。</span> <span>如果返回警告,可以调用<code>getNextWarning</code> ,等等,直到没有更多的警告。</span> </p><p></p></li>
<li> <span><b>3.7可加入界面</b></span> <p> <span><code>Joinable</code>接口提供了连接和断开的<code>RowSet</code>对象具有在SQL <code>JOIN</code>操作中添加到<code>JoinRowSet</code>对象的功能。</span> <span><code>RowSet</code>已经实现对象<code>Joinable</code>接口可以设置匹配列,获取匹配列或取消设置匹配列。</span> <span>一个<code>JoinRowSet</code>对象可以使用<code>RowSet</code>对象的匹配列作为添加<code>RowSet</code>对象的基础。</span> </p></li>
<li> <span><b>3.8 RowSetFactory接口</b></span> <p> <span><strong>必须</strong>提供一个<code>RowSetFactory</code>实现。</span> </p></li>
</ul>
<h3> <span><a name="relspec">4.0 Related Specifications</a></span> </h3>
<ul>
<li> <span><a href="http://java.sun.com/products/jdbc">JDBC 3.0 Specification</a></span> </li>
<li> <span><a href="http://www.w3.org/XML/Schema">XML Schema</a></span> </li>
<li> <span><a href="http://www.syncml.org">SyncML</a></span> </li>
</ul>
<h3> <span><a name="reldocs">5.0 Related Documentation</a></span> </h3>
<ul>
<li> <span><a href="http://java.sun.com/developer/Books/JDBCTutorial/chapter5.html">JDBC RowSet Tutorial</a></span> </li>
</ul>
</div>
</div>