src/java.sql/share/classes/javax/sql/package-info.java
author naoto
Tue, 12 Nov 2019 14:05:18 -0800
changeset 59043 1a79b4bfc85a
parent 58446 5c83830390ba
child 58679 9c3209ff7550
permissions -rw-r--r--
8232860: Error formatting integer values with MessageFormat.format() using HOST provider Reviewed-by: rriggs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
52991
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
     1
/**
55303
fcc702f17582 8225322: Broken links in java.sql
lancea
parents: 52991
diff changeset
     2
 * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
52991
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
58446
5c83830390ba 8231663: Incorrect GPL header in some RMI/SQL package-info.java files
rriggs
parents: 55303
diff changeset
     4
 *
52991
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
58446
5c83830390ba 8231663: Incorrect GPL header in some RMI/SQL package-info.java files
rriggs
parents: 55303
diff changeset
    10
 *
52991
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    15
 * accompanied this code).
58446
5c83830390ba 8231663: Incorrect GPL header in some RMI/SQL package-info.java files
rriggs
parents: 55303
diff changeset
    16
 *
52991
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
58446
5c83830390ba 8231663: Incorrect GPL header in some RMI/SQL package-info.java files
rriggs
parents: 55303
diff changeset
    20
 *
52991
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    23
 * questions.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    24
 */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
52991
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    26
/**
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    27
 * Provides the API for server side data source access and processing from
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    28
 * the Java™ programming language.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    29
 * This package supplements the <code>java.sql</code>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    30
 * package and, as of the version 1.4 release, is included in the
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    31
 * Java Platform, Standard Edition (Java SE&trade;).
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    32
 * It remains an essential part of the Java Platform, Enterprise Edition
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    33
 * (Java EE&trade;).
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    34
 * <p>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    35
 * The <code>javax.sql</code> package provides for the following:
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    36
 * <OL>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    37
 * <LI>The <code>DataSource</code> interface as an alternative to the
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    38
 * <code>DriverManager</code> for establishing a
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    39
 * connection with a data source
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    40
 * <LI>Connection pooling and Statement pooling
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    41
 * <LI>Distributed transactions
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    42
 * <LI>Rowsets
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    43
 * </OL>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    44
 * <p>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    45
 * Applications use the <code>DataSource</code> and <code>RowSet</code>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    46
 * APIs directly, but the connection pooling and distributed transaction
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    47
 * APIs are used internally by the middle-tier infrastructure.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    48
 *
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    49
 * <H2>Using a <code>DataSource</code> Object to Make a Connection</H2>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    50
 * <p>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    51
 * The <code>javax.sql</code> package provides the preferred
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    52
 * way to make a connection with a data source.  The <code>DriverManager</code>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    53
 * class, the original mechanism, is still valid, and code using it will
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    54
 * continue to run.  However, the newer <code>DataSource</code> mechanism
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    55
 * is preferred because it offers many advantages over the
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    56
 * <code>DriverManager</code> mechanism.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    57
 * <p>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    58
 * These are the main advantages of using a <code>DataSource</code> object to
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    59
 * make a connection:
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    60
 * <UL>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    61
 *
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    62
 * <LI>Changes can be made to a data source's properties, which means
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    63
 * that it is not necessary to make changes in application code when
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    64
 * something about the data source or driver changes.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    65
 * <LI>Connection  and Statement pooling and distributed transactions are available
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    66
 * through a <code>DataSource</code> object that is
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    67
 * implemented to work with the middle-tier infrastructure.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    68
 * Connections made through the <code>DriverManager</code>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    69
 * do not have connection and statement pooling or distributed transaction
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    70
 * capabilities.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    71
 * </UL>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    72
 * <p>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    73
 * Driver vendors provide <code>DataSource</code> implementations. A
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    74
 * particular <code>DataSource</code> object represents a particular
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    75
 * physical data source, and each connection the <code>DataSource</code> object
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    76
 * creates is a connection to that physical data source.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    77
 * <p>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    78
 * A logical name for the data source is registered with a naming service that
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    79
 * uses the Java Naming and Directory Interface&trade;
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    80
 * (JNDI) API, usually by a system administrator or someone performing the
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    81
 * duties of a system administrator. An application can retrieve the
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    82
 * <code>DataSource</code> object it wants by doing a lookup on the logical
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    83
 * name that has been registered for it.  The application can then use the
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    84
 * <code>DataSource</code> object to create a connection to the physical data
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    85
 * source it represents.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    86
 * <p>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    87
 * A <code>DataSource</code> object can be implemented to work with the
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    88
 * middle tier infrastructure so that the connections it produces will be
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    89
 * pooled for reuse. An application that uses such a <code>DataSource</code>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    90
 * implementation will automatically get a connection that participates in
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    91
 * connection pooling.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    92
 * A <code>DataSource</code> object can also be implemented to work with the
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    93
 * middle tier infrastructure so that the connections it produces can be
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    94
 * used for distributed transactions without any special coding.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    95
 *
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    96
 * <H2>Connection Pooling and Statement Pooling</H2>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    97
 * <p>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    98
 * Connections made via a <code>DataSource</code>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
    99
 * object that is implemented to work with a middle tier connection pool manager
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   100
 * will participate in connection pooling.  This can improve performance
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   101
 * dramatically because creating new connections is very expensive.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   102
 * Connection pooling allows a connection to be used and reused,
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   103
 * thus cutting down substantially on the number of new connections
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   104
 * that need to be created.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   105
 * <p>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   106
 * Connection pooling is totally transparent.  It is done automatically
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   107
 * in the middle tier of a Java EE configuration, so from an application's
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   108
 * viewpoint, no change in code is required. An application simply uses
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   109
 * the <code>DataSource.getConnection</code> method to get the pooled
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   110
 * connection and uses it the same way it uses any <code>Connection</code>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   111
 * object.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   112
 * <p>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   113
 * The classes and interfaces used for connection pooling are:
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   114
 * <UL>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   115
 * <LI><code>ConnectionPoolDataSource</code>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   116
 * <LI><code>PooledConnection</code>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   117
 * <LI><code>ConnectionEvent</code>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   118
 * <LI><code>ConnectionEventListener</code>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   119
 * <LI><code>StatementEvent</code>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   120
 * <LI><code>StatementEventListener</code>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   121
 * </UL>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   122
 * The connection pool manager, a facility in the middle tier of
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   123
 * a three-tier architecture, uses these classes and interfaces
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   124
 * behind the scenes.  When a <code>ConnectionPoolDataSource</code> object
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   125
 * is called on to create a <code>PooledConnection</code> object, the
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   126
 * connection pool manager will register as a <code>ConnectionEventListener</code>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   127
 * object with the new <code>PooledConnection</code> object.  When the connection
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   128
 * is closed or there is an error, the connection pool manager (being a listener)
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   129
 * gets a notification that includes a <code>ConnectionEvent</code> object.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   130
 * <p>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   131
 * If the connection pool manager supports <code>Statement</code> pooling, for
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   132
 * <code>PreparedStatements</code>, which can be determined by invoking the method
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   133
 * <code>DatabaseMetaData.supportsStatementPooling</code>,  the
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   134
 * connection pool manager will register as a <code>StatementEventListener</code>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   135
 * object with the new <code>PooledConnection</code> object.  When the
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   136
 * <code>PreparedStatement</code> is closed or there is an error, the connection
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   137
 * pool manager (being a listener)
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   138
 * gets a notification that includes a <code>StatementEvent</code> object.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   139
 *
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   140
 * <H2>Distributed Transactions</H2>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   141
 * <p>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   142
 * As with pooled connections, connections made via a <code>DataSource</code>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   143
 * object that is implemented to work with the middle tier infrastructure
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   144
 * may participate in distributed transactions.  This gives an application
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   145
 * the ability to involve data sources on multiple servers in a single
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   146
 * transaction.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   147
 * <p>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   148
 * The classes and interfaces used for distributed transactions are:
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   149
 * <UL>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   150
 * <LI><code>XADataSource</code>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   151
 * <LI><code>XAConnection</code>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   152
 * </UL>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   153
 * These interfaces are used by the transaction manager; an application does
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   154
 * not use them directly.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   155
 * <p>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   156
 * The <code>XAConnection</code> interface is derived from the
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   157
 * <code>PooledConnection</code> interface, so what applies to a pooled connection
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   158
 * also applies to a connection that is part of a distributed transaction.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   159
 * A transaction manager in the middle tier handles everything transparently.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   160
 * The only change in application code is that an application cannot do anything
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   161
 * that would interfere with the transaction manager's handling of the transaction.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   162
 * Specifically, an application cannot call the methods <code>Connection.commit</code>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   163
 * or <code>Connection.rollback</code>, and it cannot set the connection to be in
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   164
 * auto-commit mode (that is, it cannot call
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   165
 * <code>Connection.setAutoCommit(true)</code>).
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   166
 * <p>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   167
 * An application does not need to do anything special to participate in a
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   168
 * distributed transaction.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   169
 * It simply creates connections to the data sources it wants to use via
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   170
 * the <code>DataSource.getConnection</code> method, just as it normally does.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   171
 * The transaction manager manages the transaction behind the scenes.  The
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   172
 * <code>XADataSource</code> interface creates <code>XAConnection</code> objects, and
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   173
 * each <code>XAConnection</code> object creates an <code>XAResource</code> object
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   174
 * that the transaction manager uses to manage the connection.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   175
 *
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   176
 *
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   177
 * <H2>Rowsets</H2>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   178
 * The <code>RowSet</code> interface works with various other classes and
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   179
 * interfaces behind the scenes. These can be grouped into three categories.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   180
 * <OL>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   181
 * <LI>Event Notification
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   182
 * <UL>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   183
 * <LI><code>RowSetListener</code><br>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   184
 * A <code>RowSet</code> object is a JavaBeans&trade;
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   185
 * component because it has properties and participates in the JavaBeans
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   186
 * event notification mechanism. The <code>RowSetListener</code> interface
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   187
 * is implemented by a component that wants to be notified about events that
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   188
 * occur to a particular <code>RowSet</code> object.  Such a component registers
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   189
 * itself as a listener with a rowset via the <code>RowSet.addRowSetListener</code>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   190
 * method.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   191
 * <p>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   192
 * When the <code>RowSet</code> object changes one of its rows, changes all of
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   193
 * it rows, or moves its cursor, it also notifies each listener that is registered
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   194
 * with it.  The listener reacts by carrying out its implementation of the
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   195
 * notification method called on it.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   196
 * <LI><code>RowSetEvent</code><br>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   197
 * As part of its internal notification process, a <code>RowSet</code> object
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   198
 * creates an instance of <code>RowSetEvent</code> and passes it to the listener.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   199
 * The listener can use this <code>RowSetEvent</code> object to find out which rowset
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   200
 * had the event.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   201
 * </UL>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   202
 * <LI>Metadata
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   203
 * <UL>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   204
 * <LI><code>RowSetMetaData</code><br>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   205
 * This interface, derived from the
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   206
 * <code>ResultSetMetaData</code> interface, provides information about
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   207
 * the columns in a <code>RowSet</code> object.  An application can use
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   208
 * <code>RowSetMetaData</code> methods to find out how many columns the
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   209
 * rowset contains and what kind of data each column can contain.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   210
 * <p>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   211
 * The <code>RowSetMetaData</code> interface provides methods for
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   212
 * setting the information about columns, but an application would not
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   213
 * normally use these methods.  When an application calls the <code>RowSet</code>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   214
 * method <code>execute</code>, the <code>RowSet</code> object will contain
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   215
 * a new set of rows, and its <code>RowSetMetaData</code> object will have been
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   216
 * internally updated to contain information about the new columns.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   217
 * </UL>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   218
 * <LI>The Reader/Writer Facility<br>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   219
 * A <code>RowSet</code> object that implements the <code>RowSetInternal</code>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   220
 * interface can call on the <code>RowSetReader</code> object associated with it
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   221
 * to populate itself with data.  It can also call on the <code>RowSetWriter</code>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   222
 * object associated with it to write any changes to its rows back to the
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   223
 * data source from which it originally got the rows.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   224
 * A rowset that remains connected to its data source does not need to use a
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   225
 * reader and writer because it can simply operate on the data source directly.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   226
 *
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   227
 * <UL>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   228
 * <LI><code>RowSetInternal</code><br>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   229
 * By implementing the <code>RowSetInternal</code> interface, a
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   230
 * <code>RowSet</code> object gets access to
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   231
 * its internal state and is able to call on its reader and writer. A rowset
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   232
 * keeps track of the values in its current rows and of the values that immediately
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   233
 * preceded the current ones, referred to as the <i>original</i> values.  A rowset
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   234
 * also keeps track of (1) the parameters that have been set for its command and
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   235
 * (2) the connection that was passed to it, if any.  A rowset uses the
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   236
 * <code>RowSetInternal</code> methods behind the scenes to get access to
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   237
 * this information.  An application does not normally invoke these methods directly.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   238
 *
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   239
 * <LI><code>RowSetReader</code><br>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   240
 * A disconnected <code>RowSet</code> object that has implemented the
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   241
 * <code>RowSetInternal</code> interface can call on its reader (the
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   242
 * <code>RowSetReader</code> object associated with it) to populate it with
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   243
 * data.  When an application calls the <code>RowSet.execute</code> method,
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   244
 * that method calls on the rowset's reader to do much of the work. Implementations
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   245
 * can vary widely, but generally a reader makes a connection to the data source,
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   246
 * reads data from the data source and populates the rowset with it, and closes
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   247
 * the connection. A reader may also update the <code>RowSetMetaData</code> object
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   248
 * for its rowset.  The rowset's internal state is also updated, either by the
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   249
 * reader or directly by the method <code>RowSet.execute</code>.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   250
 *
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   251
 *
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   252
 * <LI><code>RowSetWriter</code><br>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   253
 * A disconnected <code>RowSet</code> object that has implemented the
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   254
 * <code>RowSetInternal</code> interface can call on its writer (the
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   255
 * <code>RowSetWriter</code> object associated with it) to write changes
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   256
 * back to the underlying data source.  Implementations may vary widely, but
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   257
 * generally, a writer will do the following:
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   258
 *
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   259
 * <UL>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   260
 * <LI>Make a connection to the data source
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   261
 * <LI>Check to see whether there is a conflict, that is, whether
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   262
 * a value that has been changed in the rowset has also been changed
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   263
 * in the data source
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   264
 * <LI>Write the new values to the data source if there is no conflict
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   265
 * <LI>Close the connection
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   266
 * </UL>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   267
 *
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   268
 *
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   269
 * </UL>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   270
 * </OL>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   271
 * <p>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   272
 * The <code>RowSet</code> interface may be implemented in any number of
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   273
 * ways, and anyone may write an implementation. Developers are encouraged
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   274
 * to use their imaginations in coming up with new ways to use rowsets.
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   275
 *
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   276
 *
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   277
 * <h2>Package Specification</h2>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   278
 *
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   279
 * <ul>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   280
 * <li><a href="https://jcp.org/en/jsr/detail?id=221">JDBC 4.3 Specification</a>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   281
 * </ul>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   282
 *
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   283
 * <h2>Related Documentation</h2>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   284
 * <p>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   285
 * The Java Series book published by Addison-Wesley Longman provides detailed
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   286
 * information about the classes and interfaces in the <code>javax.sql</code>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   287
 * package:
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   288
 *
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   289
 * <ul>
55303
fcc702f17582 8225322: Broken links in java.sql
lancea
parents: 52991
diff changeset
   290
 * <li>&ldquo;<i>JDBC&#8482;API Tutorial and Reference, Third Edition</i>&rdquo;
52991
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   291
 * </ul>
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   292
 */
9e28eff3d40f 8215309: Convert package.html files to package-info.java files
rriggs
parents: 47216
diff changeset
   293
package javax.sql;