Oracle8i JDBC Developer's Guide and Reference
Release 8.1.5

A64685-01

Library

Product

Index

Next

Contents

Title and Copyright Information

Send Us Your Comments

Preface

1 Overview

What is JDBC?
JDBC versus SQLJ
Advantages of SQLJ over JDBC for Static SQL
General Guidelines for using JDBC and SQLJ
Basic Driver Architecture
JDBC Thin Client-Side Driver Architecture
JDBC OCI Client-Side Driver Architecture
JDBC Server Driver Architecture
Oracle Extensions to the JDBC Standard
Supported JDK and JDBC Versions
JDBC and the Oracle Application Server
JDBC and IDEs

2 Getting Started

Oracle JDBC Drivers
Introducing the Oracle JDBC Drivers
Choosing the Appropriate Driver
Requirements and Compatibilities for Oracle JDBC Drivers
Verifying a JDBC Client Installation
Check Installed Directories and Files
Check the Environment Variables
Make Sure You Can Compile and Run Java
Determining the Version of the JDBC Driver
Testing JDBC and the Database Connection: JdbcCheckup

3 Basic Features

First Steps in JDBC
Importing Packages
Registering the JDBC Drivers
Opening a Connection to a Database
Creating a Statement Object
Executing a Query and Returning a Result Set Object
Processing the Result Set
Closing the Result Set and Statement Objects
Closing the Connection
Sample: Connecting, Querying, and Processing the Results
Datatype Mappings
Oracle JDBC Extension Types
Using Java Streams in JDBC
Streaming LONG or LONG RAW Columns
Streaming CHAR, VARCHAR, or RAW Columns
Data Streaming and Multiple Columns
Streaming and Row Prefetching
Closing a Stream
Streaming LOBs and External Files
Using Stored Procedures in JDBC Programs
PL/SQL Stored Procedures
Java Stored Procedures
Error Messages and JDBC
Server-Side Basics
Session and Transaction Context
Connecting to the Database
Application Basics versus Applet Basics
Application Basics
Applet Basics

4 Oracle Extensions

Introduction to Oracle Extensions
Oracle JDBC Packages and Classes
Classes of the oracle.jdbc2 Package
Classes of the oracle.sql Package
Classes of the oracle.jdbc.driver Package
Data Access and Manipulation: Oracle Types vs. Java Types
Data Conversion Considerations
Using Result Set and Statement Extensions
Comparing get and set Methods for oracle.sql.* Format with Java Format
Using Result Set Meta Data Extensions
Working with LOBs
Getting BLOB and CLOB Locators
Passing BLOB and CLOB Locators
Reading and Writing BLOB and CLOB Data
Creating and Populating a BLOB or CLOB Column
Accessing and Manipulating BLOB and CLOB Data
Getting BFILE Locators
Passing BFILE Locators
Reading BFILE Data
Creating and Populating a BFILE Column
Accessing and Manipulating BFILE Data
Working with Oracle Object Types
Using Default Java Classes for Oracle Objects
Creating Custom Java Classes for Oracle Objects
Using JPublisher with JDBC
Working with Oracle Object References
Retrieving an Object Reference
Passing an Object Reference to a Callable Statement
Accessing and Updating Object Values through an Object Reference
Passing an Object Reference to a Prepared Statement
Working with Arrays
Retrieving an Array and its Elements
Passing an Array to a Prepared Statement
Passing an Array to a Callable Statement
Using a Type Map to Map Array Elements
Additional Oracle Extensions
Performance Extensions
Additional Type Extensions
Oracle JDBC Notes and Limitations

5 Advanced Topics

Using NLS
How JDBC Drivers Perform NLS Conversions
NLS Restrictions
Working with Applets
Coding Applets
Connecting an Applet to a Database
Using Applets with Firewalls
Packaging Applets
Specifying an Applet in an HTML Page
Browser Security and JDK Version Considerations
JDBC on the Server: the Server Driver
Connecting to the Database with the Server Driver
Session and Transaction Context for the Server Driver
Testing JDBC on the Server
Server Driver Support for NLS
Embedded SQL92 Syntax
Time and Date Literals
Scalar Functions
LIKE Escape Characters
Outer Joins
Function Call Syntax
SQL92 to SQL Syntax Example

6 Coding Tips and Troubleshooting

JDBC and Multi-Threading
Performance Optimization
Disabling Auto-Commit Mode
Prefetching Rows
Batching Updates
Common Problems
Space Padding for CHAR Columns Defined as OUT or IN/OUT Variables
Memory Leaks and Running Out of Cursors
Boolean Parameters in PL/SQL Stored Procedures
Opening More Than 16 OCI Connections for a Process
Basic Debugging Procedures
Trapping Exceptions
Logging JDBC Calls
Net8 Tracing to Trap Network Events
Using Third Party Tools
Transaction Isolation Levels and the Oracle Server

7 Sample Applications

Sample Applications for Basic JDBC Features
Streaming Data
Sample Applications for JDBC 2.0-Compliant Oracle Extensions
LOB Sample
BFILE Sample
Sample Applications for Other Oracle Extensions
REF CURSOR Sample
Array Sample
Creating Customized Java Classes for Oracle Objects
SQLData Sample
CustomDatum Sample
Creating Signed Applets
JDBC versus SQLJ Sample Code
SQL Program to Create Tables and Objects
JDBC Version of the Sample Code
SQLJ Version of the Sample Code

8 Reference Information

Valid SQL-JDBC Datatype Mappings
Supported SQL and PL/SQL Datatypes
NLS Character Set Support
Related Information
Oracle JDBC Drivers and SQLJ
Java Technology
Signed Applets

A JDBC Error Messages



Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Index