Tài liệu Oracle Database JDBC Developer''''s Guide and Reference - Pdf 90

Oracle® Database
JDBC Developer's Guide and Reference
10g Release 1 (10.1)
Part No. B10979-02
June 2004
This book describes how to use the Oracle JDBC drivers to
develop powerful Java database applications.
Oracle Database JDBC Developer's Guide and Reference 10g Release 1 (10.1)
Part No. B10979-02
Copyright © 1999, 2004, Oracle. All rights reserved.
Primary Author: Elizabeth Hanes Perry, Brian Wright, Thomas Pfaeffle
Contributing Author: Brian Martin
Contributor: Kuassi Mensah, Magdi Morsi, Ron Peterson, Ekkehard Rohwedder, Ashok Shivarudraiah,
Catherine Wong, Ed Shirk, Tong Zhou, Longxing Deng, Jean de Lavarene, Rosie Chen, Sunil Kunisetty, Joyce
Yang, Mehul Bastawala, Luxi Chidambaran, Srinath Krishnaswamy, Rajkumar Irudayaraj, Scott Urman,
Jerry Schwarz, Steve Ding, Soulaiman Htite, Douglas Surber, Anthony Lai, Paul Lo, Prabha Krishna, Ellen
Siegal, Susan Kraft, Sheryl Maring, Angie Long
The Programs (which include both the software and documentation) contain proprietary information; they
are provided under a license agreement containing restrictions on use and disclosure and are also protected
by copyright, patent, and other intellectual and industrial property laws. Reverse engineering, disassembly,
or decompilation of the Programs, except to the extent required to obtain interoperability with other
independently created software or as specified by law, is prohibited.
The information contained in this document is subject to change without notice. If you find any problems in
the documentation, please report them to us in writing. This document is not warranted to be error-free.
Except as may be expressly permitted in your license agreement for these Programs, no part of these
Programs may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any
purpose.
If the Programs are delivered to the United States Government or anyone licensing or using the Programs on
behalf of the United States Government, the following notice is applicable:
U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data
delivered to U.S. Government customers are "commercial computer software" or "commercial technical data"

Related Documents ................................................................................................................................. xxv
Conventions ............................................................................................................................................ xxvii
1 Overview
What is JDBC?........................................................................................................................................... 1-1
Overview of the Oracle JDBC Drivers ................................................................................................. 1-1
Common Features of Oracle JDBC Drivers.................................................................................... 1-2
JDBC Thin Driver ............................................................................................................................... 1-3
JDBC OCI Driver................................................................................................................................ 1-3
JDBC Server-Side Thin Driver.......................................................................................................... 1-4
About Permission for the Server-Side Thin Driver................................................................ 1-4
JDBC Server-Side Internal Driver .................................................................................................... 1-4
Choosing the Appropriate Driver.................................................................................................... 1-5
Overview of Application and Applet Functionality ......................................................................... 1-5
Applet Basics....................................................................................................................................... 1-5
Applets and Security .................................................................................................................. 1-5
Applets and Firewalls ................................................................................................................ 1-6
Packaging and Deploying Applets........................................................................................... 1-6
Oracle Extensions............................................................................................................................... 1-6
Server-Side Basics .................................................................................................................................... 1-6
Session and Transaction Context..................................................................................................... 1-6
Connecting to the Database .............................................................................................................. 1-7
Environments and Support .................................................................................................................... 1-7
Supported JDK and JDBC Versions................................................................................................. 1-7
Backward Compatibility............................................................................................................ 1-7
Forward Compatibility .............................................................................................................. 1-7
JNI and Java Environments .............................................................................................................. 1-7
JDBC and IDEs.................................................................................................................................... 1-7
Changes At This Release ........................................................................................................................ 1-8
iv
New Features ...................................................................................................................................... 1-8

TNSNames Alias Syntax......................................................................................................... 3-10
4 Basic Features
First Steps in JDBC .................................................................................................................................. 4-1
Importing Packages ........................................................................................................................... 4-2
Opening a Connection to a Database .............................................................................................. 4-2
Specifying a Database URL, User Name, and Password ...................................................... 4-2
Specifying a Database URL That Includes User Name and Password............................... 4-3
Supported Connection Properties ............................................................................................ 4-3
Using Roles for Sys Logon......................................................................................................... 4-6
Configuring To Permit Use of sysdba .............................................................................. 4-6
Bequeath Connection and Sys Logon ...................................................................................... 4-6
Remote Connection..................................................................................................................... 4-7
v
Properties for Oracle Performance Extensions....................................................................... 4-8
Example................................................................................................................................. 4-8
Creating a Statement Object ............................................................................................................. 4-8
Executing a Query and Returning a Result Set Object ................................................................. 4-9
Processing the Result Set................................................................................................................... 4-9
Closing the Result Set and Statement Objects................................................................................ 4-9
Making Changes to the Database ................................................................................................. 4-10
Committing Changes...................................................................................................................... 4-10
Closing the Connection .................................................................................................................. 4-11
Sample: Connecting, Querying, and Processing the Results........................................................ 4-11
Datatype Mappings............................................................................................................................... 4-12
Table of Mappings .......................................................................................................................... 4-12
Notes Regarding Mappings........................................................................................................... 4-14
Regarding User-Defined Types ............................................................................................. 4-14
Regarding NUMBER Types ................................................................................................... 4-14
Java Streams in JDBC ........................................................................................................................... 4-14
Streaming LONG or LONG RAW Columns............................................................................... 4-15

Extended Feature Support ................................................................................................................ 5-2
Standard versus Oracle Performance Enhancement APIs ........................................................... 5-2
Migration from JDK 1.1.x.................................................................................................................. 5-3
JDBC 3.0 Support: JDK 1.4 and Previous Releases............................................................................ 5-3
Overview of Supported JDBC 3.0 Features ......................................................................................... 5-3
Unsupported JDBC 3.0 Features ...................................................................................................... 5-4
Transaction Savepoints............................................................................................................................ 5-4
Creating a Savepoint.......................................................................................................................... 5-4
Rolling back to a Savepoint .............................................................................................................. 5-5
Releasing a Savepoint........................................................................................................................ 5-5
Checking Savepoint Support............................................................................................................ 5-5
Savepoint Notes.................................................................................................................................. 5-5
Savepoint Interfaces........................................................................................................................... 5-5
Pre-JDK1.4 Savepoint Support ......................................................................................................... 5-6
JDBC 3.0 LOB Interface Methods.......................................................................................................... 5-6
6 Statement Caching
About Statement Caching....................................................................................................................... 6-1
Basics of Statement Caching ............................................................................................................. 6-1
Implicit Statement Caching .............................................................................................................. 6-2
Explicit Statement Caching............................................................................................................... 6-2
Using Statement Caching ....................................................................................................................... 6-3
Enabling and Disabling Statement Caching................................................................................... 6-3
Enabling and Disabling Implicit Statement Caching............................................................. 6-3
Enabling and Disabling Explicit Statement Caching............................................................. 6-4
Checking for Statement Creation Status......................................................................................... 6-4
Physically Closing a Cached Statement.......................................................................................... 6-5
Using Implicit Statement Caching................................................................................................... 6-5
Allocating a Statement for Implicit Caching........................................................................... 6-5
Disabling Implicit Statement Caching for a Particular Statement ....................................... 6-5
Implicitly Caching a Statement................................................................................................. 6-6

AbandonedConnectionTimeout ............................................................................................... 7-9
PropertyCheckInterval............................................................................................................... 7-9
Other Properties ................................................................................................................................. 7-9
AttributeWeights......................................................................................................................... 7-9
ClosestConnectionMatch ........................................................................................................... 7-9
ConnectionWaitTimeout............................................................................................................ 7-9
LowerThresholdLimit ................................................................................................................ 7-9
ValidateConnection .................................................................................................................... 7-9
Connection Property Example ......................................................................................................... 7-9
Connection Cache Manager API ........................................................................................................ 7-10
createCache ...................................................................................................................................... 7-10
removeCache ................................................................................................................................... 7-11
reinitializeCache.............................................................................................................................. 7-11
existsCache....................................................................................................................................... 7-11
enableCache ..................................................................................................................................... 7-11
disableCache .................................................................................................................................... 7-12
refreshCache .................................................................................................................................... 7-12
purgeCache ...................................................................................................................................... 7-12
getCacheProperties ......................................................................................................................... 7-12
getCacheNameList.......................................................................................................................... 7-12
getNumberOfAvailableConnections............................................................................................ 7-12
getNumberOfActiveConnections ................................................................................................. 7-12
setConnectionPoolDataSource ...................................................................................................... 7-13
Example Of ConnectionCacheManager Use............................................................................... 7-13
Advanced Topics.................................................................................................................................... 7-13
Attribute Weights And Connection Matching............................................................................ 7-14
ClosestConnectionMatch ........................................................................................................ 7-14
AttributeWeights...................................................................................................................... 7-14
Connection Cache Callbacks ......................................................................................................... 7-14
8 Fast Connection Failover

End ............................................................................................................................................. 9-10
Prepare....................................................................................................................................... 9-10
Commit...................................................................................................................................... 9-11
Roll back .................................................................................................................................... 9-11
Forget ......................................................................................................................................... 9-11
Recover ...................................................................................................................................... 9-11
Check for same RM.................................................................................................................. 9-12
XA ID Interface and Oracle Implementation .............................................................................. 9-12
Error Handling and Optimizations.................................................................................................... 9-13
XA Exception Classes and Methods............................................................................................. 9-13
Mapping between Oracle Errors and XA Errors ........................................................................ 9-14
XA Error Handling.......................................................................................................................... 9-14
Oracle XA Optimizations............................................................................................................... 9-14
Implementing a Distributed Transaction ......................................................................................... 9-15
Summary of Imports for Oracle XA ............................................................................................. 9-15
Oracle XA Code Sample................................................................................................................. 9-15
10 Oracle Extensions
Introduction to Oracle Extensions ..................................................................................................... 10-1
ix
Support Features of the Oracle Extensions ..................................................................................... 10-2
Support for Oracle Datatypes ....................................................................................................... 10-2
Support for Oracle Objects............................................................................................................. 10-2
Support for Schema Naming......................................................................................................... 10-3
OCI Extensions ................................................................................................................................ 10-4
Oracle JDBC Packages and Classes ................................................................................................... 10-4
Package oracle.sql ........................................................................................................................... 10-4
Classes of the oracle.sql Package ........................................................................................... 10-5
General oracle.sql.* Datatype Support.................................................................................. 10-6
Overview of Class oracle.sql.STRUCT.................................................................................. 10-7
Overview of Class oracle.sql.REF.......................................................................................... 10-8

Example: Accessing REF CURSOR Data............................................................................ 10-24
11 Accessing and Manipulating Oracle Data
Data Conversion Considerations ....................................................................................................... 11-1
Standard Types Versus Oracle Types .......................................................................................... 11-1
Converting SQL NULL Data ........................................................................................................ 11-2
x
Testing for NULLs .......................................................................................................................... 11-2
Result Set and Statement Extensions ................................................................................................ 11-2
Comparison of Oracle get and set Methods to Standard JDBC .................................................. 11-3
Standard getObject() Method ........................................................................................................ 11-3
Oracle getOracleObject() Method ................................................................................................. 11-3
Example: Using getOracleObject() with a ResultSet........................................................... 11-4
Example: Using getOracleObject() in a Callable Statement............................................... 11-4
Summary of getObject() and getOracleObject() Return Types................................................. 11-4
Other getXXX() Methods................................................................................................................ 11-5
Return Types of getXXX() Methods ...................................................................................... 11-6
Special Notes about getXXX() Methods................................................................................ 11-7
getBigDecimal() Note....................................................................................................... 11-7
getBoolean() Note ............................................................................................................. 11-7
Datatypes For Returned Objects from getObject and getXXX.................................................. 11-7
Example: Casting Return Values ........................................................................................... 11-8
The setObject() and setOracleObject() Methods ......................................................................... 11-8
Example: Using setObject() and setOracleObject() ............................................................. 11-8
Other setXXX() Methods ................................................................................................................ 11-9
Input Parameter Types of setXXX() Methods...................................................................... 11-9
Setter Method Size Limitations............................................................................................ 11-11
Setter Methods That Take Additional Input...................................................................... 11-11
Method setFixedCHAR() for Binding CHAR Data into WHERE Clauses .................... 11-12
Example............................................................................................................................ 11-12
Using Result Set Meta Data Extensions.......................................................................................... 11-13

Materializing Object Types not Specified in the Type File .............................................. 13-10
Understanding the SQLData Interface....................................................................................... 13-11
Understanding the SQLInput and SQLOutput Interfaces............................................... 13-11
Implementing readSQL() and writeSQL() Methods......................................................... 13-11
Reading and Writing Data with a SQLData Implementation ................................................ 13-12
Reading SQLData Objects from a Result Set...................................................................... 13-12
Retrieving SQLData Objects from a Callable Statement OUT Parameter ..................... 13-13
Passing SQLData Objects to a Callable Statement as an IN Parameter ......................... 13-14
Writing Data to an Oracle Object Using a SQLData Implementation............................ 13-14
Understanding the ORAData Interface ..................................................................................... 13-15
Understanding ORAData Features ..................................................................................... 13-15
Retrieving and Inserting Object Data.................................................................................. 13-16
Reading and Writing Data with a ORAData Implementation ............................................... 13-17
Reading Data from an Oracle Object Using a ORAData Implementation .................... 13-17
Writing Data to an Oracle Object Using a ORAData Implementation .......................... 13-18
Additional Uses for ORAData..................................................................................................... 13-19
The Deprecated CustomDatum Interface.................................................................................. 13-20
Object-Type Inheritance .................................................................................................................... 13-20
Creating Subtypes ......................................................................................................................... 13-21
Implementing Customized Classes for Subtypes..................................................................... 13-22
Use of ORAData for Type Inheritance Hierarchy............................................................. 13-22
Person.java using ORAData.......................................................................................... 13-22
Student.java extending Person.java ............................................................................. 13-23
ORADataFactory Implementation ............................................................................... 13-23
Use of SQLData for Type Inheritance Hierarchy .............................................................. 13-24
Person.java using SQLData........................................................................................... 13-24
Student.java extending Student.java............................................................................ 13-25
Student.java using SQLData ......................................................................................... 13-26
JPublisher Utility.................................................................................................................... 13-26
Retrieving Subtype Objects.......................................................................................................... 13-26

Example: Passing a BLOB Locator to a Prepared Statement...................................... 14-4
Example: Passing a CLOB Locator to a Callable Statement ....................................... 14-4
Reading and Writing BLOB and CLOB Data.............................................................................. 14-4
Example: Reading BLOB Data ............................................................................................... 14-5
Example: Reading CLOB Data............................................................................................... 14-5
Example: Writing BLOB Data ............................................................................................... 14-6
Example: Writing CLOB Data................................................................................................ 14-6
Creating and Populating a BLOB or CLOB Column ................................................................. 14-7
Creating a BLOB or CLOB Column in a New Table........................................................... 14-7
Populating a BLOB or CLOB Column in a New Table ...................................................... 14-7
Accessing and Manipulating BLOB and CLOB Data ................................................................ 14-8
Additional BLOB and CLOB Features ......................................................................................... 14-9
Additional BLOB Methods ..................................................................................................... 14-9
Additional CLOB Methods................................................................................................... 14-10
Creating Empty LOBs ........................................................................................................... 14-11
Shortcuts For Inserting and Retrieving CLOB Data..................................................................... 14-11
Working With Temporary LOBs ....................................................................................................... 14-12
Creating Temporary NCLOBs..................................................................................................... 14-13
Using Open and Close With LOBs .................................................................................................. 14-13
Working with BFILEs ......................................................................................................................... 14-14
Getting and Passing BFILE Locators.......................................................................................... 14-14
Retrieving BFILE Locators.................................................................................................... 14-14
Example: Getting a BFILE locator from a Result Set ................................................ 14-14
Example: Getting a BFILE Locator from a Callable Statement ................................ 14-15
Passing BFILE Locators......................................................................................................... 14-15
Example: Passing a BFILE Locator to a Prepared Statement ................................... 14-15
xiii
Example: Passing a BFILE Locator to a Callable Statement ..................................... 14-15
Reading BFILE Data...................................................................................................................... 14-16
Example: Reading BFILE Data............................................................................................. 14-16

ARRAY Performance Extension Methods ........................................................................................ 16-5
Accessing oracle.sql.ARRAY Elements as Arrays of Java Primitive Types............................ 16-5
ARRAY Automatic Element Buffering ........................................................................................ 16-6
ARRAY Automatic Indexing......................................................................................................... 16-6
Creating and Using Arrays .................................................................................................................. 16-7
Creating ARRAY Objects and Descriptors.................................................................................. 16-7
Steps in Creating ArrayDescriptor and ARRAY Objects ................................................... 16-7
Creating Multi-Level Collections........................................................................................... 16-8
Using ArrayDescriptor Methods ........................................................................................... 16-9
Serializable ARRAY Descriptors ......................................................................................... 16-10
Retrieving an Array and Its Elements........................................................................................ 16-10
xiv
Retrieving the Array ............................................................................................................. 16-10
Data Retrieval Methods ........................................................................................................ 16-11
getOracleArray() ............................................................................................................. 16-11
getResultSet()................................................................................................................... 16-11
getArray()......................................................................................................................... 16-11
Comparing the Data Retrieval Methods............................................................................. 16-12
Retrieving Elements of a Structured Object Array According to a Type Map ............. 16-12
Retrieving a Subset of Array Elements ............................................................................... 16-13
Retrieving Array Elements into an oracle.sql.Datum Array ........................................... 16-13
Accessing Multi-Level Collection Elements....................................................................... 16-14
Passing Arrays to Statement Objects.......................................................................................... 16-15
Passing an Array to a Prepared Statement......................................................................... 16-15
Passing an Array to a Callable Statement .......................................................................... 16-16
Using a Type Map to Map Array Elements .................................................................................... 16-16
Custom Collection Classes with JPublisher .................................................................................. 16-18
17 Result Set Enhancements
Overview................................................................................................................................................. 17-1
Result Set Functionality and Result Set Categories Supported in JDBC 2.0........................... 17-1

Updating Result Sets .......................................................................................................................... 17-11
Performing a DELETE Operation in a Result Set ..................................................................... 17-11
Performing an UPDATE Operation in a Result Set ................................................................. 17-12
Example................................................................................................................................... 17-13
Performing an INSERT Operation in a Result Set.................................................................... 17-13
Example................................................................................................................................... 17-14
Update Conflicts............................................................................................................................ 17-14
Fetch Size .............................................................................................................................................. 17-15
Setting the Fetch Size .................................................................................................................... 17-15
Use of Standard Fetch Size versus Oracle Row-Prefetch Setting........................................... 17-16
Refetching Rows.................................................................................................................................. 17-16
Seeing Database Changes Made Internally and Externally........................................................ 17-17
Seeing Internal Changes............................................................................................................... 17-17
Seeing External Changes.............................................................................................................. 17-17
Visibility versus Detection of External Changes ...................................................................... 17-18
Summary of Visibility of Internal and External Changes ....................................................... 17-19
Oracle Implementation of Scroll-Sensitive Result Sets............................................................ 17-19
Summary of New Methods for Result Set Enhancements.......................................................... 17-20
Modified Connection Methods ................................................................................................... 17-20
New Result Set Methods.............................................................................................................. 17-20
Statement Methods ....................................................................................................................... 17-22
Database Meta Data Methods ..................................................................................................... 17-23
18 Row Set
Introduction............................................................................................................................................ 18-1
Row Set Setup and Configuration ..................................................................................................... 18-2
Runtime Properties for Row Set......................................................................................................... 18-2
Row Set Listener.................................................................................................................................... 18-2
Traversing Through the Rows............................................................................................................. 18-3
Cached Row Set ..................................................................................................................................... 18-4
CachedRowSet Constraints ........................................................................................................... 18-7

JDBC Default Mappings ................................................................................................ 19-13
Oracle Mappings............................................................................................................. 19-14
Java Primitive Type Mappings ..................................................................................... 19-14
20 OCI Instant Client
Overview ................................................................................................................................................ 20-1
Benefits of Instant Client..................................................................................................................... 20-2
JDBC OCI Instant Client Installation Process................................................................................. 20-2
When to Use Instant Client ................................................................................................................. 20-3
Patching Instant Client Shared Libraries ......................................................................................... 20-3
Regeneration of Data Shared Library................................................................................................ 20-4
Database Connection Names for OCI Instant Client..................................................................... 20-4
Environment Variables for OCI Instant Client ............................................................................... 20-5
21 End-To-End Metrics Support
Introduction............................................................................................................................................ 21-1
JDBC API For End-To-End Metrics.................................................................................................... 21-2
22 Performance Extensions
Update Batching .................................................................................................................................... 22-1
Overview of Update Batching Models......................................................................................... 22-1
Oracle Model versus Standard Model .................................................................................. 22-2
Types of Statements Supported ............................................................................................. 22-2
Oracle Update Batching ................................................................................................................. 22-3
Oracle Update Batching Characteristics and Limitations .................................................. 22-3
Setting the Connection Batch Value ...................................................................................... 22-4
Setting the Statement Batch Value......................................................................................... 22-4
Checking the Batch Value....................................................................................................... 22-5
Overriding the Batch Value ................................................................................................... 22-5
Committing the Changes in Oracle Batching ...................................................................... 22-6
xvii
Update Counts in Oracle Batching........................................................................................ 22-6
Standard Update Batching............................................................................................................. 22-8

Installing and Running the Oracle Connection Manager .................................................. 24-3
Writing the URL that Targets the Connection Manager .................................................... 24-4
Connecting through Multiple Connection Managers......................................................... 24-4
Using Signed Applets..................................................................................................................... 24-4
Using Applets with Firewalls ............................................................................................................ 24-5
Configuring a Firewall for Applets that use the JDBC Thin Driver ........................................ 24-5
Writing a URL to Connect through a Firewall............................................................................ 24-6
Packaging Applets................................................................................................................................. 24-7
Specifying an Applet in an HTML Page........................................................................................... 24-8
CODE, HEIGHT, and WIDTH ...................................................................................................... 24-8
CODEBASE ...................................................................................................................................... 24-8
ARCHIVE ......................................................................................................................................... 24-8
xviii
25 Reference Information
Valid SQL-JDBC Datatype Mappings............................................................................................... 25-1
Supported SQL and PL/SQL Datatypes............................................................................................ 25-3
Embedded SQL92 Syntax .................................................................................................................... 25-7
Disabling Escape Processing ......................................................................................................... 25-7
Time and Date Literals ................................................................................................................... 25-7
Date Literals.............................................................................................................................. 25-7
Time Literals ............................................................................................................................. 25-8
Timestamp Literals .................................................................................................................. 25-8
Scalar Functions............................................................................................................................... 25-9
LIKE Escape Characters ................................................................................................................. 25-9
Outer Joins...................................................................................................................................... 25-10
Function Call Syntax..................................................................................................................... 25-10
SQL92 to SQL Syntax Example ................................................................................................... 25-10
Oracle JDBC Notes and Limitations................................................................................................ 25-11
CursorName................................................................................................................................... 25-11
SQL92 Outer Join Escapes............................................................................................................ 25-11

Common Problems................................................................................................................................ 28-7
Memory Consumption for CHAR Columns Defined as OUT or IN/OUT Variables.......... 28-7
Memory Leaks and Running Out of Cursors.............................................................................. 28-7
Boolean Parameters in PL/SQL Stored Procedures................................................................... 28-7
Opening More Than 16 OCI Connections for a Process............................................................ 28-8
Using statement.cancel() ................................................................................................................ 28-8
Basic Debugging Procedures .............................................................................................................. 28-9
Oracle Net Tracing to Trap Network Events .............................................................................. 28-9
Client-Side Tracing ............................................................................................................... 28-10
TRACE_LEVEL_CLIENT ............................................................................................. 28-10
TRACE_DIRECTORY_CLIENT ................................................................................... 28-10
TRACE_FILE_CLIENT .................................................................................................. 28-10
TRACE_UNIQUE_CLIENT ......................................................................................... 28-11
Server-Side Tracing ............................................................................................................... 28-11
TRACE_LEVEL_SERVER ............................................................................................. 28-11
TRACE_DIRECTORY_SERVER .................................................................................. 28-11
TRACE_FILE_SERVER .................................................................................................. 28-11
Third Party Debugging Tools ..................................................................................................... 28-12
Transaction Isolation Levels and Access Modes ........................................................................... 28-12
A JDBC Error Messages
General Structure of JDBC Error Messages ....................................................................................... A-1
General JDBC Messages ........................................................................................................................ A-1
JDBC Messages Sorted by ORA Number ...................................................................................... A-1
JDBC Messages Sorted Alphabetically........................................................................................... A-5
HeteroRM XA Messages ........................................................................................................................ A-9
HeteroRM XA Messages Sorted by ORA Number ...................................................................... A-9
HeteroRM XA Messages Sorted Alphabetically........................................................................... A-9
TTC Messages ........................................................................................................................................ A-10
TTC Messages Sorted by ORA Number ...................................................................................... A-10
TTC Messages Sorted Alphabetically........................................................................................... A-11

19–1 PL/SQL Types and Corresponding JDBC Types............................................................. 19-10
19–2 Arguments of the setPlsqlIndexTable () Method ............................................................. 19-11
19–3 Arguments of the registerIndexTableOutParameter () Method .................................... 19-12
19–4 Argument of the getPlsqlIndexTable () Method .............................................................. 19-13
19–5 Argument of the getOraclePlsqlIndexTable () Method................................................... 19-14
19–6 Arguments of the getPlsqlIndexTable () Method............................................................. 19-15
20–1 OCI Instant Client Shared Libraries..................................................................................... 20-1
21–1 Maximum Lengths for End-to-End Metrics........................................................................ 21-1
22–1 Valid Column Type Specifications..................................................................................... 22-19
23–1 Client/Server Negotiations for Encryption or Integrity ................................................... 23-3
23–2 OCI Driver Client Parameters for Encryption and Integrity............................................ 23-4
23–3 Thin Driver Client Parameters for Encryption and Integrity........................................... 23-5
25–1 Valid SQL Datatype-Java Class Mappings.......................................................................... 25-1
25–2 Support for SQL Datatypes ................................................................................................... 25-3
25–3 Support for ANSI-92 SQL Datatypes ................................................................................... 25-4
25–4 Support for SQL User-Defined Types.................................................................................. 25-5
25–5 Support for PL/SQL Datatypes ............................................................................................ 25-5
28–1 Mapping of SQL Datatypes to Java Classes that Represent SQL Datatypes.................. 28-6
xxi
Send Us Your Comments
Oracle Database JDBC Developer's Guide and Reference 10g Release 1 (10.1)
Part No. B10979-02
Oracle welcomes your comments and suggestions on the quality and usefulness of this
publication. Your input is an important part of the information used for revision.

Did you find any errors?

Is the information clearly presented?

Do you need more information? If so, where?


Intended Audience

Documentation Accessibility

Structure

Related Documents

Conventions
Intended Audience
The Oracle Database JDBC Developer's Guide and Reference is intended for developers of
JDBC-based applications and applets. This book can be read by anyone with an
interest in JDBC programming, but assumes at least some prior knowledge of the
following:

Java

Oracle PL/SQL

Oracle databases
Documentation Accessibility
Our goal is to make Oracle products, services, and supporting documentation
accessible, with good usability, to the disabled community. To that end, our
documentation includes features that make information available to users of assistive
technology. This documentation is available in HTML format, and contains markup to
facilitate access by the disabled community. Standards will continue to evolve over
time, and Oracle is actively engaged with other market-leading technology vendors to
address technical obstacles so that our documentation can be accessible to all of our
customers. For additional information, visit the Oracle Accessibility Program Web site

the JDK.

Chapter 6, "Statement Caching"—Describes Oracle extension statements for
caching.

Chapter 7, "Implicit Connection Caching"—Discusses the new implicit connection
cache.

Chapter 8, "Fast Connection Failover"—Describes the fast connection failover
mechanism, which depends on the implicit connection cache.

Chapter 9, "Distributed Transactions"—Covers distributed transactions, otherwise
known as global transactions, and standard XA functionality. (Distributed
transactions are sets of transactions, often to multiple databases, that must be
committed in a coordinated manner.)

Chapter 10, "Oracle Extensions"—Provides an overview of the JDBC extension
classes supplied by Oracle.

Chapter 11, "Accessing and Manipulating Oracle Data"—Describes data access
using the Oracle datatype formats rather than Java formats.

Chapter 12, "Globalization Support"—Describes support for multi-byte character
sets and other globalization issues.

Chapter 13, "Working with Oracle Object Types"—Explains how to map Oracle
object types to Java classes by using either standard JDBC or Oracle extensions.

Chapter 14, "Working with LOBs and BFILEs"—Covers the Oracle extensions to
the JDBC standard that let you access and manipulate LOBs and LOB data.

Chapter 24, "JDBC in Applets"—Describes how to work with applets

Chapter 25, "Reference Information"—Contains detailed JDBC reference
information.

Chapter 27, "Proxy Authentication"—Describes middle-tier authentication using
proxies.

Chapter 28, "Coding Tips and Troubleshooting"—Includes coding tips and general
guidelines for troubleshooting your JDBC applications.

Appendix A, "JDBC Error Messages"—Lists JDBC error messages and the
corresponding
ORA
error numbers.
Related Documents
The following books are also available from the Oracle Java Platform group:

Oracle Database Java Developer's Guide
This book introduces the basic concepts of Java and provides general information
about server-side configuration and functionality. Information that pertains to the
Oracle Java platform as a whole, rather than to a particular product (such as JDBC)
is in this book. This book also discusses Java stored procedures, which were
formerly discussed in a standalone book.

Oracle Database JPublisher User's Guide
This book describes how to use the Oracle JPublisher utility to translate object
types and other user-defined types to Java classes. If you are developing JDBC
applications that use object types, VARRAY types, nested table types, or object
reference types, then JPublisher can generate custom Java classes to map to them.


Nhờ tải bản gốc

Tài liệu, ebook tham khảo khác

Music ♫

Copyright: Tài liệu đại học © DMCA.com Protection Status