Oracle® Database JDBC Developer's Guide and Reference 10g Release 2 (10.2) Part Number B14355-01 |
|
|
View PDF |
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:
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:
Java
Oracle PL/SQL
Oracle databases
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.
This document contains the following chapters and appendixes:
Contains chapters that provide an overview of JDBC and the Oracle implementation of JDBC.
Provides an overview of the Oracle implementation of JDBC and the Oracle JDBC driver architecture.
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.
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.
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.
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.
Discusses JDBC 2.0 result set enhancements such as scrollable result sets and updatable result sets.
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.
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.
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.
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.
Describes methods to optimize a JDBC application or applet.
Appendix C, "JDBC Error Messages"
Lists JDBC error messages and the corresponding ORA
error numbers.
Provides information on troubleshooting a JDBC application or applet.
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.
The following OC4J documents, for Oracle Application Server releases, are also available from the Oracle Java Platform group:
Oracle Application Server Containers for J2EE User's Guide
This book provides some overview and general information for OC4J; primer chapters for servlets, JSP pages, and EJBs; and general configuration and deployment instructions.
Oracle Application Server Containers for J2EE Support for JavaServer Pages Developer's Guide
This book provides information for JSP developers who want to run their pages in OC4J. It includes a general overview of JSP standards and programming considerations, as well as discussion of Oracle value-added features and steps for getting started in the OC4J environment.
Oracle Application Server Containers for J2EE JSP Tag Libraries and Utilities Reference
This book provides conceptual information and detailed syntax and usage information for tag libraries, JavaBeans, and other Java utilities provided with OC4J.
Oracle Application Server Containers for J2EE Servlet Developer's Guide
This book provides information for servlet developers regarding use of servlets and the servlet container in OC4J. It also documents relevant OC4J configuration files.
Oracle Application Server Containers for J2EE Services Guide
This book provides information about basic Java services supplied with OC4J, such as JTA, JNDI, and the Oracle Application Server Java Object Cache.
Oracle Application Server Containers for J2EE Enterprise JavaBeans Developer's Guide
This book provides information about the EJB implementation and EJB container in OC4J.
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:
Oracle JDeveloper online help
Oracle JDeveloper documentation on the Oracle Technology Network:
http://otn.oracle.com/products/jdev/content.html
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:
Web site for JDBC, including the latest specifications:
jdbc-interest
discussion group for JDBC
To subscribe, send an e-mail to listserv@java.sun.com
with the following line in the body of the message:
subscribe jdbc-interest yourlastname yourfirstname
We recommend that you request only the daily digest of the posted e-mails. To do this add the following line to the message body as well:
set jdbc-interest digest
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 Query the Use the |
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 Back up the datafiles and control files in the The Set the Connect as The |
lowercase italic monospace (fixed-width) font |
Lowercase italic monospace font represents placeholders or variables. | You can specify the parallel_clause .
Run |
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:
|
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:
This release complies with Optimal Flexible Architecture (OFA) guidelines. All subdirectories are not under a top level 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. |