jdk/src/share/classes/java/sql/package.html
author lancea
Fri, 04 Feb 2011 09:07:00 -0500
changeset 8178 0236f423f7d1
parent 5551 327690766109
child 15278 e081d3f73b75
permissions -rw-r--r--
7014095: Broken link in java.sql package specification Reviewed-by: alanb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
<html>
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
<head>
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
<!--
8178
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
     5
 Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    10
published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    12
by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
5551
327690766109 6956202: Fix a few missed rebranding issues, please contact lines etc.
ohair
parents: 5506
diff changeset
    24
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
327690766109 6956202: Fix a few missed rebranding issues, please contact lines etc.
ohair
parents: 5506
diff changeset
    25
or visit www.oracle.com if you need additional information or have any
327690766109 6956202: Fix a few missed rebranding issues, please contact lines etc.
ohair
parents: 5506
diff changeset
    26
questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
-->
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
</head>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
<body bgcolor="white">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
Provides the API for accessing and processing data stored in a 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
data source (usually a relational database) using the 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
Java<sup><font size=-2>TM</font></sup> programming language. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
This API includes a framework whereby different
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
drivers can be installed dynamically to access different data sources.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
Although the JDBC<sup><font size=-2>TM</font></sup> API is mainly geared 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
to passing SQL statements to a database, it provides for reading and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
writing data from any data source with a tabular format.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
The reader/writer facility, available through the 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
<code>javax.sql.RowSet</code> group of interfaces, can be customized to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
use and update data from a spread sheet, flat file, or any other tabular 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
data source.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
<P>
8178
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
    48
<h2>What the JDBC<sup><font size=-2>TM</font></sup> 4.1 API Includes</h2>
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
    49
The JDBC<sup><font size=-2>TM</font></sup> 4.1 API includes both
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
the <code>java.sql</code> package, referred to as the JDBC core API,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
and the <code>javax.sql</code> package, referred to as the JDBC Optional
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
Package API. This complete JDBC API
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
is included in the Java<sup><font size=-2>TM</font></sup>  
8178
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
    54
Standard Edition (Java SE<sup><font size=-2>TM</font></sup>), version 7.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
The <code>javax.sql</code> package extends the functionality of the JDBC API 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
from a client-side API to a server-side API, and it is an essential part
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
of the Java<sup><font size=-2>TM</font></sup>  Enterprise Edition
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
(Java EE<sup><font size=-2>TM</font></sup>) technology. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
<h2>Versions</h2>
8178
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
    61
The JDBC 4.1 API incorporates all of the previous JDBC API versions:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
<UL>
8178
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
    63
 <LI> The JDBC 4.0 API
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 <LI> The JDBC 3.0 API
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 <LI> The JDBC 2.1 core API
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 <LI> The JDBC 2.0 Optional Package API<br>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
      (Note that the JDBC 2.1 core API and the JDBC 2.0 Optional Package
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
      API together are referred to as the JDBC 2.0 API.)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
 <LI> The JDBC 1.2 API
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 <LI> The JDBC 1.0 API
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
</UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
Classes, interfaces, methods, fields, constructors, and exceptions 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
have the following "since" tags that indicate when they were introduced 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
into the Java platform. When these "since" tags are used in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
Javadoc<sup><font size=-2>TM</font></sup> comments for the JDBC API,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
they indicate the following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
<UL>
8178
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
    79
 <LI>Since 1.7 -- new in the JDBC 4.1 API and part of the Java SE platform,
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
    80
     version 7
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
    81
<LI>Since 1.6 -- new in the JDBC 4.0 API and part of the Java SE platform,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     version 6
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
 <LI>Since 1.4 -- new in the JDBC 3.0 API and part of the J2SE platform, 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     version 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
 <LI>Since 1.2 -- new in the JDBC 2.0 API and part of the J2SE platform, 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     version 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
 <LI>Since 1.1 or no "since" tag -- in the original JDBC 1.0 API and part of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
      the JDK<sup><font size=-2>TM</font></sup>, version 1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
</UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
<b>NOTE:</b> Many of the new features are optional; consequently, there is 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
some variation in drivers and the features they support. Always 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
check your driver's documentation to see whether it supports a feature before
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
you try to use it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
<b>NOTE:</b> The class <code>SQLPermission</code> was added in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
Java<sup><font size=-2>TM</font></sup> 2 SDK, Standard Edition, 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
version 1.3 release. This class is used to prevent unauthorized
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
access to the logging stream associated with the <code>DriverManager</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
which may contain information such as table names, column data, and so on.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
<h2>What the <code>java.sql</code> Package Contains</h2>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
The <code>java.sql</code> package contains API for the following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
<UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
  <LI>Making a connection with a database via the <code>DriverManager</code> facility
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
  <UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
	 <LI><code>DriverManager</code> class -- makes a connection with a driver
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
	 <LI><code>SQLPermission</code> class -- provides permission when code
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
                  running within a Security Manager, such as an applet,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
                  attempts to set up a logging stream through the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
                  <code>DriverManager</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
	 <LI><code>Driver</code> interface -- provides the API for registering
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
             and connecting drivers based on JDBC technology ("JDBC drivers"); 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
             generally used only by the <code>DriverManager</code> class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
	 <LI><code>DriverPropertyInfo</code> class -- provides properties for a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
             JDBC driver; not used by the general user
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
  </UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
  <LI>Sending SQL statements to a database
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
  <UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
	 <LI><code>Statement</code> --  used to send basic SQL statements
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
	 <LI><code>PreparedStatement</code> --  used to send prepared statements or 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
              basic SQL statements (derived from <code>Statement</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
	 <LI><code>CallableStatement</code> --  used to call database stored 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
              procedures (derived from <code>PreparedStatement</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
	 <LI><code>Connection</code> interface --  provides methods for creating
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
             statements and managing connections and their properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
	 <LI><code>Savepoint</code> --  provides savepoints in a transaction
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
  </UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
  <LI>Retrieving and updating the results of a query
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
  <UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
	 <LI><code>ResultSet</code> interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
  </UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
  <LI>Standard mappings for SQL types to classes and interfaces in the 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
      Java programming language
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
  <UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
	 <LI><code>Array</code> interface -- mapping for SQL <code>ARRAY</code> 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
	 <LI><code>Blob</code> interface -- mapping for SQL <code>BLOB</code> 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
	 <LI><code>Clob</code> interface -- mapping for SQL <code>CLOB</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
	 <LI><code>Date</code> class -- mapping for SQL <code>DATE</code> 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
	  <LI><code>NClob</code> interface -- mapping for SQL <code>NCLOB</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
	 <LI><code>Ref</code> interface -- mapping for SQL <code>REF</code> 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
	  <LI><code>RowId</code> interface -- mapping for SQL <code>ROWID</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
	 <LI><code>Struct</code> interface -- mapping for SQL <code>STRUCT</code> 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
	  <LI><code>SQLXML</code> interface -- mapping for SQL <code>XML</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
	 <LI><code>Time</code> class -- mapping for SQL <code>TIME</code> 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
	 <LI><code>Timestamp</code> class -- mapping for SQL <code>TIMESTAMP</code> 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
	 <LI><code>Types</code> class -- provides constants for SQL types
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
  </UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
  <LI>Custom mapping an SQL user-defined type (UDT) to a class in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
	  Java programming language
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
  <UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
	 <LI><code>SQLData</code> interface -- specifies the mapping of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
              a UDT to an instance of this class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
	 <LI><code>SQLInput</code> interface -- provides methods for reading
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
              UDT attributes from a stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
	 <LI><code>SQLOutput</code> interface -- provides methods for writing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
              UDT attributes back to a stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
  </UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
  <LI>Metadata
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
  <UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
	 <LI><code>DatabaseMetaData</code> interface -- provides information
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
              about the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
	 <LI><code>ResultSetMetaData</code> interface -- provides information
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
              about the columns of a <code>ResultSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
	 <LI><code>ParameterMetaData</code> interface -- provides information
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
              about the parameters to <code>PreparedStatement</code> commands
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
  </UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
  <LI>Exceptions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
	<UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
	  <LI><code>SQLException</code> -- thrown by most methods when there
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
		 is a problem accessing data and by some methods for other reasons
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
	  <LI><code>SQLWarning</code> -- thrown to indicate a warning
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
	  <LI><code>DataTruncation</code> -- thrown to indicate that data may have
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     	  been truncated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
	  <LI><code>BatchUpdateException</code> -- thrown to indicate that not all
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
		 commands in a batch update executed successfully
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
	</UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
</UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
<P>
8178
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
   182
    <h3><code>java.sql</code> and <code>javax.sql</code> Features Introduced in the JDBC 4.1 API</h3>
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
   183
<UL>
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
   184
    <LI>Allow <code>Connection</code>,
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
   185
        <code>ResultSet</code> and <code>Statement</code> objects to be
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
   186
        used with the try-with-resources statement</LI>
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
   187
    <LI>Supported added to <code>CallableStatement</code> and
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
   188
        <code>ResultSet</code> to specify the Java type to convert to via the
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
   189
        <code>getObject</code> method</LI>
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
   190
    <LI><code>DatabaseMetaData</code> methods to return PseudoColumns and if a
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
   191
        generated key is always returned</LI>
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
   192
    <LI>Added support to <code>Connection</code> to specify a database schema,
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
   193
    abort and timeout a physical connection.</LI>
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
   194
    <LI>Added support to close a <code>Statement</code> object when its dependent
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
   195
    objects have been closed</LI>
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
   196
    <LI>Support for obtaining the parent logger for a <code>Driver</code>,
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
   197
     <code>DataSource</code>, <code>ConnectionPoolDataSource</code> and
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
   198
     <code>XADataSource</code></LI>
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
   199
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
   200
</UL>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
<h3><code>java.sql</code> and <code>javax.sql</code> Features Introduced in the JDBC 4.0 API</h3>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
<UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
  <LI>auto java.sql.Driver discovery -- no longer need to load a 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
<code>java.sql.Driver</code> class via <code>Class.forName</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
 <LI>National Character Set support added
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
 <li>Support added for the SQL:2003 XML data type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
 <lI>SQLException enhancements -- Added support for cause chaining; New SQLExceptions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
 added for common SQLState class value codes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
 <li>Enhanced Blob/Clob functionality -- Support provided to create and free a Blob/Clob instance
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
 as well as additional methods added to improve accessiblity
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
 <li>Support added for accessing a SQL ROWID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
 <li>Support added to allow a JDBC application to access an instance of a JDBC resource
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
 that has been wrapped by a vendor, usually in an application server or connection 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
 pooling environment.
8178
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
   215
 <li>Availability to be notified when a <code>PreparedStatement</code> that is associated
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
 with a <code>PooledConnection</code> has been closed or the driver determines is invalid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
</UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
<h3><code>java.sql</code> and <code>javax.sql</code> Features Introduced in the JDBC 3.0 API</h3>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
<UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
  <LI>Pooled statements -- reuse of statements associated with a pooled 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
       connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
  <LI>Savepoints -- allow a transaction to be rolled back to a designated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
      savepoint
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
  <LI>Properties defined for <code>ConnectionPoolDataSource</code> -- specify
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
      how connections are to be pooled
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
  <LI>Metadata for parameters of a <code>PreparedStatement</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
  <LI>Ability to retrieve values from automatically generated columns
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
  <LI>Ability to have multiple <code>ResultSet</code> objects 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
       returned from <code>CallableStatement</code> objects open at the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
      same time
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
  <LI>Ability to identify parameters to <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
      objects by name as well as by index
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
  <LI><code>ResultSet</code> holdability -- ability to specify whether cursors
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
      should be held open or closed at the end of a transaction
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
  <LI>Ability to retrieve and update the SQL structured type instance that a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
      <code>Ref</code> object references
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
  <LI>Ability to programmatically update <code>BLOB</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
      <code>CLOB</code>, <code>ARRAY</code>, and <code>REF</code> values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
  <LI>Addition of the <code>java.sql.Types.DATALINK</code> data type -- 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
      allows JDBC drivers access to objects stored outside a data source
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
  <LI>Addition of metadata for retrieving SQL type hierarchies
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
</UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
<h3><code>java.sql</code> Features Introduced in the JDBC 2.1 Core API</h3>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
<UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
  <LI>Scrollable result sets--using new methods in the <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
	  interface that allow the cursor to be moved to a particular row or to a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
	  position relative to its current position
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
  <LI>Batch updates
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
  <LI>Programmatic updates--using <code>ResultSet</code> updater methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
  <LI>New data types--interfaces mapping the SQL3 data types
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
  <LI>Custom mapping of user-defined types (UDTs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
  <LI>Miscellaneous features, including performance hints, the use of character
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
	  streams, full precision for <code>java.math.BigDecimal</code> values,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
	  additional security, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
	  support for time zones in date, time, and timestamp values. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
</UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
<h3><code>javax.sql</code> Features Introduced in the JDBC 2.0 Optional
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
Package API</h3>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
<UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
  <LI>The <code>DataSource</code> interface as a means of making a connection.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
      Java Naming and Directory Interface<sup><font size=-2>TM</font></sup>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
      (JNDI) is used for registering a <code>DataSource</code> object with a 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
      naming service and also for  retrieving it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
  <LI>Pooled connections -- allowing connections to be used and reused
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
  <LI>Distributed transactions -- allowing a transaction to span diverse
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
      DBMS servers
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
  <LI><code>RowSet</code> technology -- providing a convenient means of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
       handling and passing data
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
</UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
<h3>Custom Mapping of UDTs</h3>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
A user-defined type (UDT) defined in SQL can be mapped to a class in the Java
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
programming language. An SQL structured type or an SQL <code>DISTINCT</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
type are the UDTs that may be custom mapped.  The following three
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
steps set up a custom mapping:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
<ol>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
  <li>Defining the SQL structured type or <code>DISTINCT</code> type in SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
  <li>Defining the class in the Java programming language to which the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
	  SQL UDT will be mapped.  This class must implement the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
	  <code>SQLData</code> interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
  <li>Making an entry in a <code>Connection</code> object's type map
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
      that contains two things:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
   <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
       <li>the fully-qualified SQL name of the UDT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
       <li>the <code>Class</code> object for the class that implements the 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
           <code>SQLData</code> interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
   </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
</ol>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
When these are in place for a UDT, calling the methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
<code>ResultSet.getObject</code> or <code>CallableStatement.getObject</code> 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
on that UDT will automatically retrieve the custom mapping for it. Also, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
<code>PreparedStatement.setObject</code> method will automatically map the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
object back to its SQL type to store it in the data source.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
<h2>Package Specification</h2>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
<ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
  <li><a href="http://java.sun.com/products/jdbc/download.html">Specification 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
      of the JDBC 4.0 API</a>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
</ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
<h2>Related Documentation</h2>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
<ul>
8178
0236f423f7d1 7014095: Broken link in java.sql package specification
lancea
parents: 5551
diff changeset
   313
  <li><a href="../../../technotes/guides/jdbc/getstart/GettingStartedTOC.fm.html">Getting Started</a>--overviews of the major interfaces
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
  <li><a href="http://java.sun.com/docs/books/tutorial/jdbc">Chapters on the JDBC 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
     API</a>--from the online version of <i>The Java Tutorial Continued</i>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
  <li><a href="http://java.sun.com/docs/books/jdbc">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
<i>JDBC<sup><font size=-2>TM</font></sup>API Tutorial and Reference, 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
Third Edition</i></a>--
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
a complete reference and tutorial for the JDBC 3.0 API
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
</ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
@since 1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
</body>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
</html>