Skip Headers
Oracle® Database JDBC Developer's Guide and Reference
10g Release 2 (10.2)

Part Number B14355-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

Preface

This preface introduces you to the Oracle Database JDBC Developer's Guide and Reference discussing the intended audience, structure, and conventions of this document. A list of related Oracle documents is also provided.

This Preface contains these topics:

Intended Audience

The Oracle Database JDBC Developer's Guide and Reference is intended for developers of Java Database Connectivity (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:

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. Accessibility 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 more information, visit the Oracle Accessibility Program Web site at

http://www.oracle.com/accessibility/

Accessibility of Code Examples in Documentation

Screen readers may not always correctly read the code examples in this document. The conventions for writing code require that closing braces should appear on an otherwise empty line; however, some screen readers may not always read a line of text that consists solely of a bracket or brace.

Accessibility of Links to External Web Sites in Documentation

This documentation may contain links to Web sites of other companies or organizations that Oracle does not own or control. Oracle neither evaluates nor makes any representations regarding the accessibility of these Web sites.

TTY Access to Oracle Support Services

Oracle provides dedicated Text Telephone (TTY) access to Oracle Support Services within the United States of America 24 hours a day, seven days a week. For TTY support, call 800.446.2398.

Structure

This document contains the following chapters and appendixes:

Part I, "Overview"

Contains chapters that provide an overview of JDBC and the Oracle implementation of JDBC.

Chapter 1, "Introducing JDBC"

Provides an overview of the Oracle implementation of JDBC and the Oracle JDBC driver architecture.

Chapter 2, "Getting Started"

Introduces the Oracle JDBC drivers and some scenarios of how you can use them. This chapter also guides you through the basics of testing your installation and configuration.

Chapter 3, "Basic Features"

Covers the basic steps in creating any JDBC application. It also discusses additional basic features of Java and JDBC supported by the Oracle JDBC drivers.

Part II, "Oracle JDBC"

Contains chapters that discuss different JDBC versions supported by Oracle Database 10g and features of Oracle JDBC Thin driver, Oracle Call Interface (OCI) driver, and server-side internal driver.

Chapter 4, "JDBC Standards Support"

Presents an overview of JDBC 2.0 and 3.0 features and describes how these features are supported by different versions of the Java Development Kit (JDK).

Chapter 5, "Oracle Extensions"

Provides an overview of the JDBC extension classes supplied by Oracle.

Chapter 6, "Features Specific to JDBC Thin"

Provides an overview of the features supported by the Oracle JDBC Thin driver.

Chapter 7, "Features Specific to JDBC OCI"

Describes OCI support for Instant Client.

Chapter 8, "Server-Side Internal Driver"

Describes the server-side internal driver.

Part III, "Connection and Security"

Contains chapters that discuss the use of data sources and URLs to connect to the database and security features supported by the Oracle JDBC OCI and Thin drivers.

Chapter 9, "Data Sources and URLs"

Discusses connecting applications to databases using JDBC data sources, as well as the URLs that describe databases.

Chapter 10, "JDBC Client-Side Security Features"

Describes security features of the client-side internal driver.

Chapter 11, "SSL Support"

Describes Secure Socket Layer (SSL) support in the JDBC Thin driver.

Chapter 12, "Proxy Authentication"

Describes middle-tier authentication using proxies.

Part IV, "Data Access and Manipulation"

Contains chapters that discuss about accessing and manipulating Oracle data, Java streams in JDBC, JDBC support for user-defined object types, large object (LOB) and binary file (BFILE) locators and data, object references, and Oracle collections, and globalization support provided by Oracle JDBC drivers.

Chapter 13, "Accessing and Manipulating Oracle Data"

This chapter describes data access using the Oracle data type formats rather than Java formats.

Chapter 14, "Java Streams in JDBC"

Describes how the Oracle JDBC drivers handle Java streams for several data types.

Chapter 15, "Working with Oracle Object Types"

Explains how to map Oracle object types to Java classes by using either standard JDBC or Oracle extensions.

Chapter 16, "Working with LOBs and BFILEs"

Covers the Oracle extensions to the JDBC standard that let you access and manipulate LOBs and LOB data.

Chapter 17, "Using Oracle Object References"

Describes the Oracle extensions to standard JDBC that let you access and manipulate object references.

Chapter 18, "Working with Oracle Collections"

Discusses the Oracle extensions to standard JDBC that let you access and manipulate arrays and their data.

Chapter 19, "Result Set"

Discusses JDBC 2.0 result set enhancements such as scrollable result sets and updatable result sets.

Chapter 20, "JDBC RowSets"

Describes the support for the different RowSet implementations as per the JSR-114 specification.

Chapter 21, "Globalization Support"

Describes support for multibyte character sets and other globalization issues.

Part V, "Performance Enhancements"

Contains chapters that discuss performance enhancement features, such as statement caching, implicit connection caching, and run-time connection load balancing.

Chapter 22, "Statement Caching"

Describes the benefits and use of statement caching and the Oracle extension for statements caching.

Chapter 23, "Implicit Connection Caching"

Discusses about the implicit connection cache feature and using the connection cache.

Chapter 24, "Run-Time Connection Load Balancing"

Describes the run-time connection load balancing feature that enables routing of work requests to database instances.

Chapter 25, "Performance Extensions"

Describes Oracle extensions to the JDBC standard that enhance the performance of your applications.

Chapter 26, "OCI Connection Pooling"

Describes the JDBC OCI connection pooling functionality.

Part VI, "High Availability"

Contains chapters that provide information about the high availability features, Fast Connection Failover and Transparent Application Failover (TAF).

Chapter 27, "Fast Connection Failover"

Describes the Fast Connection Failover mechanism, which depends on the implicit connection cache.

Chapter 28, "Transparent Application Failover"

Provides information about the Transparent Application Failover (TAF) feature of the JDBC OCI driver.

Part VII, "Transaction Management"

Provides information on transaction management using Oracle JDBC.

Chapter 29, "Distributed Transactions"

Covers distributed transactions, otherwise known as global transactions, and standard XA functionality.

Part VIII, "Manageability"

Discusses the end-to-end metrics support in Oracle JDBC drivers.

Chapter 30, "End-To-End Metrics Support"

Describes JDBC support for end-to-end database metrics.

Part IX, "Appendixes"

Consists of appendixes that provide detailed JDBC reference information, JDBC error messages, and tips for coding and troubleshooting JDBC applications.

Appendix A, "Reference Information"

Provides detailed JDBC reference information.

Appendix B, "Coding Tips"

Describes methods to optimize a JDBC application or applet.

Appendix C, "JDBC Error Messages"

Lists JDBC error messages and the corresponding ORA error numbers.

Appendix D, "Troubleshooting"

Provides information on troubleshooting a JDBC application or applet.

Related Documents

The following books are also available from the Oracle Java Platform group:

The following OC4J documents, for Oracle Application Server releases, are also available from the Oracle Java Platform group:

The following documents are from the Oracle Server Technologies group:

The following documents from the Oracle Application Server group may also be of some interest:

The following are available from the JDeveloper group:

Printed documentation is available for sale in the Oracle Store at:

http://oraclestore.oracle.com/

To download free release notes, installation documentation, white papers, or other collateral, visit the Oracle Technology Network (OTN). You must register online before using OTN; registration is free and can be done at

http://otn.oracle.com/membership/

If you already have a user name and password for OTN, then you can go directly to the documentation section of the OTN Web site at

http://otn.oracle.com/documentation/

The following resources are available from Sun Microsystems:

Conventions

This section describes the conventions used in the text and code examples of this documentation set. It describes:

Conventions in Text

We use various conventions in text to help you more quickly identify special terms. The following table describes those conventions and provides examples of their use.

Convention Meaning Example
Bold Bold typeface indicates terms that are defined in the text or terms that appear in a glossary, or both. When you specify this clause, you create an index-organized table.
Italics Italic typeface indicates book titles or emphasis. Oracle Database Concepts

Ensure that the recovery catalog and target database do not reside on the same disk.

UPPERCASE monospace (fixed-width) font Uppercase monospace typeface indicates elements supplied by the system. Such elements include parameters, privileges, data types, RMAN keywords, SQL keywords, SQL*Plus or utility commands, packages and methods, as well as system-supplied column names, database objects and structures, user names, and roles. You can specify this clause only for a NUMBER column.

You can back up the database by using the BACKUP command.

Query the TABLE_NAME column in the USER_TABLES data dictionary view.

Use the DBMS_STATS.GENERATE_STATS procedure.

lowercase monospace (fixed-width) font Lowercase monospace typeface indicates executables, filenames, directory names, and sample user-supplied elements. Such elements include computer and database names, net service names, and connect identifiers, as well as user-supplied database objects and structures, column names, packages and classes, user names and roles, program units, and parameter values.

Note: Some programmatic elements use a mixture of UPPERCASE and lowercase. Enter these elements as shown.

Enter sqlplus to start SQL*Plus.

The password is specified in the orapwd file.

Back up the datafiles and control files in the /disk1/oracle/dbs directory.

The department_id, department_name, and location_id columns are in the hr.departments table.

Set the QUERY_REWRITE_ENABLED initialization parameter to true.

Connect as oe user.

The JRepUtil class implements these methods.

lowercase italic monospace (fixed-width) font Lowercase italic monospace font represents placeholders or variables. You can specify the parallel_clause.

Run old_release.SQL where old_release refers to the release you installed prior to upgrading.


Conventions in Code Examples

Code examples illustrate Java, SQL, and command-line statements. Examples are displayed in a monospace (fixed-width) font and separated from normal text as shown in this example:

SELECT username FROM dba_users WHERE username = 'MIGRATE';

The following table describes typographic conventions used in code examples and provides examples of their use.

Convention Meaning Example
[ ]
Brackets enclose one or more optional items. Do not enter the brackets.
DECIMAL (digits [ , precision ])
{ }
Braces enclose two or more items, one of which is required. Do not enter the braces.
{ENABLE | DISABLE}
|

A vertical bar represents a choice of two or more options within brackets or braces. Enter one of the options. Do not enter the vertical bar.
{ENABLE | DISABLE}
[COMPRESS | NOCOMPRESS]
...
Horizontal ellipsis points indicate either:
  • That we have omitted parts of the code that are not directly related to the example

  • That you can repeat a portion of the code

CREATE TABLE ... AS subquery;

SELECT col1, col2, ... , coln FROM employees;
.
 .
 .
Vertical ellipsis points indicate that we have omitted several lines of code not directly related to the example.
SQL> SELECT NAME FROM V$DATAFILE;
NAME
------------------------------------
/fsl/dbs/tbs_01.dbf
/fs1/dbs/tbs_02.dbf
.
.
.
/fsl/dbs/tbs_09.dbf
9 rows selected.
Other notation You must enter symbols other than brackets, braces, vertical bars, and ellipsis points as shown.
acctbal NUMBER(11,2);
acct    CONSTANT NUMBER(4) := 3;
Italics
Italicized text indicates placeholders or variables for which you must supply particular values.
CONNECT SYSTEM/system_password
DB_NAME = database_name
UPPERCASE
Uppercase typeface indicates elements supplied by the system. We show these terms in uppercase in order to distinguish them from terms you define. Unless terms appear in brackets, enter them in the order and with the spelling shown. However, because these terms are not case sensitive, you can enter them in lowercase.
SELECT last_name, employee_id FROM employees;
SELECT * FROM USER_TABLES;
DROP TABLE hr.employees;
lowercase
Lowercase typeface indicates programmatic elements that you supply. For example, lowercase indicates names of tables, columns, or files.

Note: Some programmatic elements use a mixture of UPPERCASE and lowercase. Enter these elements as shown.

SELECT last_name, employee_id FROM employees;
sqlplus hr/hr
CREATE USER mjones IDENTIFIED BY ty3MU9;

Conventions for Windows Operating Systems

The following table describes conventions for Windows operating systems and provides examples of their use.

Convention Meaning Example
Choose Start > How to start a program. To start the Database Configuration Assistant, choose Start > Programs > Oracle - HOME_NAME > Configuration and Migration Tools > Database Configuration Assistant.
File and directory names File and directory names are not case sensitive. The following special characters are not allowed: left angle bracket (<), right angle bracket (>), colon (:), double quotation marks ("), slash (/), pipe (|), and dash (-). The special character backslash (\) is treated as an element separator, even when it appears in quotes. If the file name begins with \\, then Windows assumes it uses the Universal Naming Convention.
c:\winnt"\"system32 is the same as C:\WINNT\SYSTEM32
C:\> Represents the Windows command prompt of the current hard disk drive. The escape character in a command prompt is the caret (^). Your prompt reflects the subdirectory in which you are working. Referred to as the command prompt in this manual.
C:\oracle\oradata>
Special characters The backslash (\) special character is sometimes required as an escape character for the double quotation mark (") special character at the Windows command prompt. Parentheses and the single quotation mark (') do not require an escape character. Refer to your Windows operating system documentation for more information on escape and special characters.
C:\>exp scott/tiger TABLES=emp QUERY=\"WHERE job='SALESMAN' and sal<1600\"
C:\>imp SYSTEM/password FROMUSER=scott TABLES=(emp, dept)
HOME_NAME
Represents the Oracle home name. The home name can be up to 16 alphanumeric characters. The only special character allowed in the home name is the underscore.
C:\> net start OracleHOME_NAMETNSListener
ORACLE_HOME and ORACLE_BASE In releases prior to Oracle8i release 8.1.3, when you installed Oracle components, all subdirectories were located under a top level ORACLE_HOME directory that by default used one of the following names:
  • C:\orant for Windows NT

  • C:\orawin98 for Windows 98

This release complies with Optimal Flexible Architecture (OFA) guidelines. All subdirectories are not under a top level ORACLE_HOME directory. There is a top level directory called ORACLE_BASE that by default is C:\oracle. If you install the latest Oracle release on a computer with no other Oracle software installed, then the default setting for the first Oracle home directory is C:\oracle\orann, where nn is the latest release number. The Oracle home directory is located directly under ORACLE_BASE.

All directory path examples in this guide follow OFA conventions.

Refer to Oracle Database Platform Guide for Microsoft Windows (32-Bit) for additional information about OFA compliances and for information about installing Oracle products in non-OFA compliant directories.

Go to the ORACLE_BASE\ORACLE_HOME\rdbms\admin directory.