package-summary.html

来自「SUN公司官方J2EE中文帮助文档 应该不错 有兴趣的下来看看 html格式的」· HTML 代码 · 共 457 行 · 第 1/2 页

HTML
457
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Thu Jan 17 03:51:29 PST 2002 -->
<TITLE>
Java 2 Platform EE v1.3: Package javax.sql
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../javax/servlet/jsp/tagext/package-summary.html"><B>PREV PACKAGE</B></A>&nbsp;
&nbsp;<A HREF="../../javax/transaction/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="package-summary.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>
<H2>
Package javax.sql
</H2>
Provides the API for server side data source access and processing from
the Java<sup><font size=-2>TM</font></sup> programming language.
<P>
<B>See: </B>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="#package_description"><B>Description</B></A>
<P>

<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Interface Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="ConnectionEventListener.html"><I>ConnectionEventListener</I></A></B></TD>
<TD>
A ConnectionEventListener is an object that registers to receive 
events generated by a PooledConnection.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="ConnectionPoolDataSource.html"><I>ConnectionPoolDataSource</I></A></B></TD>
<TD>A ConnectionPoolDataSource object is a factory for PooledConnection
 objects.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="DataSource.html"><I>DataSource</I></A></B></TD>
<TD>A DataSource object is a factory for Connection objects.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="PooledConnection.html"><I>PooledConnection</I></A></B></TD>
<TD>A PooledConnection object is a connection object that provides
 hooks for connection pool management.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="RowSet.html"><I>RowSet</I></A></B></TD>
<TD>The RowSet interface adds support to the JDBC API for the
 JavaBeans(TM) component model.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="RowSetInternal.html"><I>RowSetInternal</I></A></B></TD>
<TD>A rowset object presents itself to a reader or writer as an instance
 of RowSetInternal.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="RowSetListener.html"><I>RowSetListener</I></A></B></TD>
<TD>The RowSetListener interface is implemented by a 
 component that wants to be notified when a significant 
 event happens in the life of a RowSet</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="RowSetMetaData.html"><I>RowSetMetaData</I></A></B></TD>
<TD>The RowSetMetaData interface extends ResultSetMetaData with 
 methods that allow a metadata object to be initialized.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="RowSetReader.html"><I>RowSetReader</I></A></B></TD>
<TD>An object implementing the RowSetReader interface may be registered with 
 a RowSet object that supports the reader/writer paradigm.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="RowSetWriter.html"><I>RowSetWriter</I></A></B></TD>
<TD>An object that implements the RowSetWriter interface may be registered
 with a RowSet object that supports the reader/writer paradigm.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="XAConnection.html"><I>XAConnection</I></A></B></TD>
<TD>An XAConnection object provides support for distributed 
 transactions.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="XADataSource.html"><I>XADataSource</I></A></B></TD>
<TD>A factory for XAConnection objects.</TD>
</TR>
</TABLE>
&nbsp;

<P>

<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Class Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="ConnectionEvent.html">ConnectionEvent</A></B></TD>
<TD>The ConnectionEvent class provides information about the source of
 a connection related event.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="RowSetEvent.html">RowSetEvent</A></B></TD>
<TD>A RowSetEvent is generated when something important happens in the 
 life of a rowset, like when a column value changes.</TD>
</TR>
</TABLE>
&nbsp;

<P>
<A NAME="package_description"><!-- --></A><H2>
Package javax.sql Description
</H2>

<P>
Provides the API for server side data source access and processing from
the Java<sup><font size=-2>TM</font></sup> programming language.
This package supplements the <code>java.sql</code>
package and, as of the version 1.4 release, is included in the 
Java<sup><font size=-2>TM</font></sup> 2 SDK, Standard Edition.
It remains an essential part of the Java 2 SDK, Enterprise Edition
(J2EE<sup><font size=-2>TM</sup></font>).
<P>
The <code>javax.sql</code> package provides for the following:
<OL>
  <LI>The <code>DataSource</code> interface as an alternative to the 
      <code>DriverManager</code> for establishing a 
      connection with a data source
  <LI>Connection pooling
  <LI>Distributed transactions
  <LI>Rowsets
</OL>
<P>
Applications use the <code>DataSource</code> and <code>RowSet</code>
APIs directly, but the connection pooling and distributed transaction
APIs are used internally by the middle-tier infrastructure.

<H2>Using a <code>DataSource</code> Object to Make a Connection</H2>

The <code>javax.sql</code> package provides the preferred
way to make a connection with a data source.  The <code>DriverManager</code>
class, the original mechanism, is still valid, and code using it will
continue to run.  However, the newer <code>DataSource</code> mechanism
is preferred because it offers many advantages over the 
<code>DriverManager</code> mechanism.
<P>
These are the main advantages of using a <code>DataSource</code> object to 
make a connection:
<UL>
  <LI>Applications do not need to hard code a driver class.
  <LI>Changes can be made to a data source's properties, which means
      that it is not necessary to make changes in application code when
      something about the data source or driver changes.
  <LI>Connection pooling and distributed transactions are available
      through a <code>DataSource</code> object that is
      implemented to work with the middle-tier infrastructure.
      Connections made through the <code>DriverManager</code>
      do not have connection pooling or distributed transaction
      capabilities.
</UL>
<P>
Driver vendors provide <code>DataSource</code> implementations. A
particular <code>DataSource</code> object represents a particular
physical data source, and each connection the <code>DataSource</code> object
creates is a connection to that physical data source. 
<P>
A logical name for the data source is registered with a naming service that
uses the Java Naming and Directory Interface<sup><font size=-2>TM</font></sup>  
(JNDI) API, usually by a system administrator or someone performing the 
duties of a system administrator. An application can retrieve the
<code>DataSource</code> object it wants by doing a lookup on the logical
name that has been registered for it.  The application can then use the 
<code>DataSource</code> object to create a connection to the physical data
source it represents.
<P>
A <code>DataSource</code> object can be implemented to work with the 
middle tier infrastructure so that the connections it produces will be
pooled for reuse. An application that uses such a <code>DataSource</code> 
implementation will automatically get a connection that participates in
connection pooling.  
A <code>DataSource</code> object can also be implemented to work with the 
middle tier infrastructure so that the connections it produces can be
used for distributed transactions without any special coding.

<H2>Connection Pooling</H2>

Connections made via a <code>DataSource</code>
object that is implemented to work with a middle tier connection pool manager
will participate in connection pooling.  This can improve performance
dramatically because creating new connections is very expensive. 
Connection pooling allows a connection to be used and reused, 
thus cutting down substantially on the number of new connections 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?