Oracle® Database JDBC Developer's Guide and Reference 10g Release 1 (10.1) Part Number B10979-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:
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
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 at
http://www.oracle.com/accessibility/
JAWS, a Windows screen reader, 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, JAWS may not always read a line of text that consists solely of a bracket or brace.
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.
This document contains the following chapters and appendices:
Chapter 1, " Overview"—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, " Datasources and URLs "—Discusses connecting applications to databases using JDBC datasources, as well as the URLs that describe databases.
Chapter 4, " 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.
Chapter 5, " JDBC Standards Support"—Presents an overview of JDBC 2.0 and 3.0 features and describes how these features are supported different versions of the JDK.
Chapter 6, " Statement Caching "—Describes Oracle extension statements for caching.
Chapter 7, " Implicit Connection Caching "—Describes 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 have to 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 15, " Using Oracle Object References "—Describes the Oracle extensions to standard JDBC that let you access and manipulate object references.
Chapter 16, " Working with Oracle Collections "—Discusses the Oracle extensions to standard JDBC that let you access and manipulate arrays and their data.
Chapter 17, " Result Set Enhancements "—This chapter discusses JDBC 2.0 result set enhancements such as scrollable result sets and updatable result sets.
Chapter 18, " Row Set "—Describes JDBC cached and web row sets.
Chapter 19, " JDBC OCI Extensions "—Describes extensions specific to the OCI driver.
Chapter 20, " OCI Instant Client"—Describes OCI support for Instant Client.
Chapter 21, " End-To-End Metrics Support "—Describes JDBC support for end-to-end database metrics.
Chapter 22, " Performance Extensions "—Describes Oracle extensions to the JDBC standard that enhance the performance of your applications.
Chapter 23, " Advanced Topics "—Describes advanced JDBC topics such as globalization support, working with applets, the server-side driver, and embedded SQL92 syntax.
Chapter 24, " Reference Information "—Contains detailed JDBC reference information.
Chapter 25, " Proxy Authentication"—Describes middle-tier authentication using proxies.
Chapter 26, " 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.
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, please 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 username 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 Java Server Pages, including the latest specifications:
Web site for Java Servlet technology, including the latest specifications:
jsp-interest
discussion group for Java Server Pages
To subscribe, send an e-mail to listserv@java.sun.com
with the following line in the body of the message:
subscribe jsp-interest yourlastname yourfirstname
It is recommended, however, 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 jsp-interest digest
This section describes the conventions used in the text and code examples of this documentation set. It describes:
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, datatypes, RMAN keywords, SQL keywords, SQL*Plus or utility commands, packages and methods, as well as system-supplied column names, database objects and structures, usernames, 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, usernames 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 |
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; |
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 Windows 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. |