Table of Contents
- List of Tables
- Title and Copyright Information
- Preface
- Changes in This Release for Oracle Database JDBC Developer's Guide
-
Part I Overview
- 1 Introducing JDBC
-
2
Getting Started
- 2.1 RDBMS and JDK Version Compatibility for Oracle JDBC Drivers
- 2.2 Verifying a JDBC Client Installation
-
2.3
Basic Steps in JDBC
- 2.3.1 Importing Packages
- 2.3.2 Opening a Connection to a Database
- 2.3.3 Creating a Statement Object
- 2.3.4 Running a Query and Retrieving a Result Set Object
- 2.3.5 Processing the Result Set Object
- 2.3.6 Closing the Result Set and Statement Objects
- 2.3.7 Making Changes to the Database
- 2.3.8 About Committing Changes
- 2.3.9 Closing the Connection
- 2.4 Sample: Connecting, Querying, and Processing the Results
- 2.5 Support for Fixed Character Semantic
- 2.6 Support for Java Virtual Threads
- 2.7 Support for Annotations
- 2.8 Support for Oracle True Cache
- 2.9 Support for the Bequeath Protocol
- 2.10 Support for Invisible Columns
- 2.11 Support for Verifying JSON Data
- 2.12 Support for Implicit Results
- 2.13 Support for Lightweight Connection Validation
- 2.14 Support for Deprioritization of Database Nodes
- 2.15 Support for Oracle Connection Manager in Traffic Director Mode
- 2.16 Stored Procedure Calls in JDBC Programs
- 2.17 About Processing SQL Exceptions
-
Part II Oracle JDBC
- 3 JDBC Standards Support
-
4
Oracle Extensions
- 4.1 Overview of Oracle Extensions
- 4.2 Features of the Oracle Extensions
- 4.3 Oracle JDBC Packages
- 4.4 Oracle Character Data Types Support
-
4.5
Additional Oracle Type Extensions
- 4.5.1 Oracle ROWID Type
- 4.5.2 Oracle REF CURSOR Type Category
- 4.5.3 Oracle BINARY_FLOAT and BINARY_DOUBLE Types
- 4.5.4 Oracle SYS.ANYTYPE and SYS.ANYDATA Types
-
4.5.5
The oracle.jdbc Package
- 4.5.5.1 Interface oracle.jdbc.OracleConnection
- 4.5.5.2 Interface oracle.jdbc.OracleStatement
- 4.5.5.3 Interface oracle.jdbc.OraclePreparedStatement
- 4.5.5.4 Interface oracle.jdbc.OracleCallableStatement
- 4.5.5.5 Interface oracle.jdbc.OracleResultSet
- 4.5.5.6 Interface oracle.jdbc.OracleResultSetMetaData
- 4.5.5.7 Class oracle.jdbc.OracleTypes
- 4.6 DML Returning
- 4.7 Accessing PL/SQL Associative Arrays
- 5 Features Specific to JDBC Thin
- 6 Features Specific to JDBC OCI Driver
- 7 Server-Side Internal Driver
-
Part III Connection and Security
-
8
Data Sources and URLs
-
8.1
About Data Sources
- 8.1.1 Overview of Oracle Data Source Support for JNDI
- 8.1.2 Features and Properties of Data Sources
- 8.1.3 Creating a Data Source Instance and Connecting
- 8.1.4 Creating a Data Source Instance, Registering with JNDI, and Connecting
- 8.1.5 Supported Connection Properties
- 8.1.6 About Using Roles for SYS Login
- 8.1.7 Configuring Database Remote Login
- 8.1.8 Using Bequeath Connection and SYS Logon
- 8.1.9 Setting Properties for Oracle Performance Extensions
- 8.1.10 Support for Network Data Compression
-
8.2
Database URLs and Database Specifiers
- 8.2.1 Support for Longer Passwords
- 8.2.2 Support for Internet Protocol Version 6
- 8.2.3 Support for HTTPS Proxy Configuration
- 8.2.4 Database Specifiers
- 8.2.5 Thin-style Service Name Syntax
- 8.2.6 Support for Easy Connect Plus
- 8.2.7 Support for Delay in Connection Retries
- 8.2.8 TNSNames Alias Syntax
- 8.2.9 LDAP Syntax
-
8.1
About Data Sources
-
9
JDBC Client-Side Security Features
- 9.1 Support for Token-Based Authentication for IAM
- 9.2 Support for Token-Based Authentication for Azure AD
- 9.3 Support for Oracle Advanced Security
- 9.4 Support for Login Authentication
- 9.5 Support for Strong Authentication
-
9.6
Support for Network Encryption and
Integrity
- 9.6.1 Overview of JDBC Support for Network Encryption and Integrity
- 9.6.2 JDBC OCI Driver Support for Encryption and Integrity
-
9.6.3
JDBC Thin Driver Support for Encryption and Integrity
- 9.6.3.1 The CONNECTION_PROPERTY_THIN_NET_ENCRYPTION_LEVEL Parameter
- 9.6.3.2 The CONNECTION_PROPERTY_THIN_NET_ENCRYPTION_TYPES Parameter
- 9.6.3.3 The CONNECTION_PROPERTY_THIN_NET_CHECKSUM_LEVEL Parameter
- 9.6.3.4 The CONNECTION_PROPERTY_THIN_NET_CHECKSUM_TYPES Parameter
- 9.6.3.5 The CONNECTION_PROPERTY_THIN_NET_AUTHENTICATION_SERVICES Parameter
- 9.6.4 Setting Encryption and Integrity Parameters in Java
-
9.7
Support for TLS
- 9.7.1 Overview of JDBC Support for TLS
- 9.7.2 About Managing Certificates and Wallets
- 9.7.3 About Keys and certificates containers
- 9.7.4 Database Connectivity with TLS Version 1.3 Using the JDBC Thin Driver
- 9.7.5 Automatic TLS Connection Configuration
- 9.7.6 Support for Default TLS Context
- 9.7.7 SNI Support for TLS Connections
- 9.7.8 Support for Key Store Service
- 9.8 Support for Kerberos
- 9.9 Support for RADIUS
- 9.10 Support for FIPS with Native Network Encryption
- 9.11 Support for PEM in JDBC
- 9.12 Support for Secure External Password Store (SEPS)
- 10 JDBC Service Provider Extensions
- 11 Proxy Authentication
-
8
Data Sources and URLs
-
Part IV Data Access and Manipulation
-
12
Accessing and Manipulating Oracle Data
- 12.1 Data Type Mappings
- 12.2 Data Conversion Considerations
- 12.3 Result Set and Statement Extensions
-
12.4
Comparison of Oracle get and set Methods to Standard JDBC
- 12.4.1 Standard getObject Method
- 12.4.2 Oracle getOracleObject Method
- 12.4.3 Summary of getObject and getOracleObject Return Types
- 12.4.4 Other getXXX Methods
- 12.4.5 Data Types For Returned Objects from getObject and getXXX
- 12.4.6 The setObject and setOracleObject Methods
- 12.4.7 Other setXXX Methods
- 12.5 Using Result Set Metadata Extensions
- 12.6 About Using SQL CALL and CALL INTO Statements
- 13 Java Streams in JDBC
-
14
Working with Vectors
- 14.1 JDBC APIs and Types for Vectors
- 14.2 SQL to Java Conversions with CallableStatement
- 14.3 SQL to Java Conversions with CallableStatment and ResultSet
- 14.4 Java to SQL Conversions with PreparedStatement and CallableStatement
- 14.5 The VECTOR Datum Class
- 14.6 Backward Compatibility with Earlier JDBC Drivers
-
15
Working with Oracle Object Types
- 15.1 About Mapping Oracle Objects
- 15.2 About Using the Default STRUCT Class for Oracle Objects
-
15.3
About Creating and Using Custom Object Classes for Oracle Objects
- 15.3.1 Overview of Creating and Using Custom Object Classes
- 15.3.2 Relative Advantages of OracleData versus SQLData
- 15.3.3 About Type Maps for SQLData Implementations
- 15.3.4 About Creating Type Map and Defining Mappings for a SQLData Implementation
- 15.3.5 About Reading and Writing Data with a SQLData Implementation
- 15.3.6 About the OracleData Interface
- 15.3.7 About Reading and Writing Data with an OracleData Implementation
- 15.3.8 Additional Uses of OracleData
- 15.4 Object-Type Inheritance
- 15.5 About Describing an Object Type
- 16 Working with Large Objects and SecureFiles
- 17 Using Oracle Object References
-
18
Working with Oracle Collections
- 18.1 Oracle Extensions for Collections
- 18.2 Overview of Collection Functionality
- 18.3 ARRAY Performance Extension Methods
-
18.4
Creating and Using Arrays
- 18.4.1 Creating ARRAY Objects
-
18.4.2
Retrieving an Array and Its Elements
- 18.4.2.1 About Retrieving the Array
- 18.4.2.2 Data Retrieval Methods
- 18.4.2.3 Comparing the Data Retrieval Methods
- 18.4.2.4 Retrieving Elements of a Structured Object Array According to a Type Map
- 18.4.2.5 Retrieving a Subset of Array Elements
- 18.4.2.6 Retrieving Array Elements into an oracle.sql.Datum Array
- 18.4.2.7 About Accessing Multilevel Collection Elements
- 18.4.3 Passing Arrays to Statement Objects
- 18.5 Using a Type Map to Map Array Elements
- 19 Result Set
- 20 JDBC RowSets
- 21 Globalization Support
-
12
Accessing and Manipulating Oracle Data
-
Part V Performance and Scalability
-
22
Statement and Result Set Caching
- 22.1 About Statement Caching
- 22.2 About Using Statement Caching
- 22.3 About Reusing Statements Objects
- 22.4 About Result Set Caching
-
23
Performance Extensions
-
23.1
Update Batching
- 23.1.1 Overview of Update Batching
-
23.1.2
Standard Update Batching
- 23.1.2.1 About Adding Operations to the Batch
- 23.1.2.2 About Processing the Batch
- 23.1.2.3 Row Count per Iteration for Array DMLs
- 23.1.2.4 About Committing the Changes in the Oracle Implementation of Standard Batching
- 23.1.2.5 About Clearing the Batch
- 23.1.2.6 Update Counts in the Oracle Implementation of Standard Batching
- 23.1.2.7 Error Handling in the Oracle Implementation of Standard Batching
- 23.1.2.8 About Intermixing Batched Statements and Nonbatched Statements
- 23.1.2.9 Limitations in the Oracle Implementation of Standard Batching
- 23.1.3 Premature Batch Flush
- 23.2 Additional Oracle Performance Extensions
-
23.1
Update Batching
-
24
JDBC Reactive Extensions
- 24.1 Overview of JDBC Reactive Extensions
-
24.2
About Building an Application with Reactive Extensions
- 24.2.1 Opening a Connection Using Asynchronous Methods
- 24.2.2 Execution of SQL Statements with Asynchronous Methods
- 24.2.3 About Fetching Row Data with Asynchronous Methods
- 24.2.4 Reading LOB Data Using Asynchronous Methods
- 24.2.5 Writing LOB Data Using Asynchronous Methods
- 24.2.6 Committing a Transaction Using Asynchronous Methods
- 24.2.7 Closing a Connection Using Asynchronous Methods
- 24.3 Threading Model of Asynchronous Methods
- 24.4 About the Flow API
- 24.5 Using the FlowAdapters Class
- 24.6 Streaming Row Data with the Reactor Library
- 24.7 Streaming Row Data with the RxJava Library
- 24.8 Streaming Row Data with the Akka Streams Library
- 24.9 Limitations of JDBC Reactive Extensions
-
25
Support for Java library for Reactive Streams Ingestion
- 25.1 Overview of the Java Library for Reactive Streams Ingestion
- 25.2 Features of the Java Library for Reactive Streams Ingestion
- 25.3 About Reactive Streams Ingestion (RSI) Modes
- 25.4 Code Samples: Java Library for Reactive Streams Ingestion
- 25.5 Limitations of Java library for Reactive Streams Ingestion
- 26 Support for Pipelined Database Operations
-
27
OCI Connection Pooling
- 27.1 Background of OCI Driver Connection Pooling
- 27.2 Comparison Between OCI Driver Connection Pooling and Shared Servers
- 27.3 About Defining an OCI Connection Pool
- 27.4 About Connecting to an OCI Connection Pool
- 27.5 Sample Code for OCI Connection Pooling
- 27.6 Statement Handling and Caching
- 27.7 JNDI and the OCI Connection Pool
-
28
Database Resident Connection Pooling
- 28.1 Overview of Database Resident Connection Pooling
- 28.2 Enabling Database Resident Connection Pooling
- 28.3 Pooled Server Processes Across Multiple Connection Pools
- 28.4 Multi-Pool Support in DRCP
- 28.5 Tagging Support in Database Resident Connection Pooling
- 28.6 PL/SQL Callback for Session State Fix Up
- 28.7 APIs for Using Database Resident Connection Pooling
- 29 JDBC Support for Database Sharding
-
30
Oracle Advanced Queuing
- 30.1 Functionality and Framework of Oracle Advanced Queuing
- 30.2 Making Changes to the Database
- 30.3 AQ Asynchronous Event Notification
- 30.4 About Creating Messages
- 30.5 Example: Creating a Message and Setting a Payload
- 30.6 Enqueuing Messages
- 30.7 Dequeuing Messages
- 30.8 Examples: Enqueuing and Dequeuing
- 31 Continuous Query Notification
-
22
Statement and Result Set Caching
-
Part VI High Availability
- 32 Transaction Guard for Java
-
33
Application Continuity for Java
- 33.1 About Configuring Oracle JDBC for Application Continuity for Java
- 33.2 About Configuring Oracle Database for Application Continuity for Java
- 33.3 Application Continuity with DRCP
- 33.4 Application Continuity Support for XA Data Source
- 33.5 About Identifying Request Boundaries in Application Continuity for Java
- 33.6 Support for Transparent Application Continuity
- 33.7 Establishing the Initial State Before Application Continuity Replays
- 33.8 About Delaying the Reconnection in Application Continuity for Java
- 33.9 About Retaining Mutable Values in Application Continuity for Java
- 33.10 Application Continuity Statistics
-
33.11
About Disabling Replay in Application Continuity for Java
- 33.11.1 How to Disable Replay
-
33.11.2
When to Disable Replay
- 33.11.2.1 Application Calls External Systems that Should not Be Repeated
- 33.11.2.2 Application Synchronizes Independent Sessions
- 33.11.2.3 Application Uses Time at the Middle-tier in the Execution Logic
- 33.11.2.4 Application assumes that ROWIds do not change
- 33.11.2.5 Application Assumes that Side Effects Execute Once
- 33.11.2.6 Application Assumes that Location Values Do not Change
- 33.11.3 Diagnostics and Tracing
-
34
Oracle JDBC Support for FAN Events
- 34.1 Overview of Oracle JDBC Support for FAN events
- 34.2 Safe Draining APIs for Planned Maintenance
- 34.3 Installation and Configuration of Oracle JDBC Driver for FAN Events Support
- 34.4 Example of Oracle JDBC Driver FAN support for Planned Maintenance
- 34.5 Using Third-Party Connection Pools with Oracle JDBC
- 35 Transparent Application Failover
-
36
Single Client Access Name
- 36.1 Overview of Single Client Access Name
- 36.2 About Configuring the Database Using the SCAN
- 36.3 How Connection Load Balancing Works Using the SCAN
- 36.4 Version and Backward Compatibility
- 36.5 Using the SCAN in a Maximum Availability Architecture Environment
- 36.6 Using the SCAN With Oracle Connection Manager
-
Part VII Transaction Management
- 37 Distributed Transactions
- 38 Sessionless Transactions
- Part VIII Manageability
-
Appendixes
- A JDBC Reference Information
- B Oracle RAC Fast Application Notification
-
C
JDBC Coding Tips
- C.1 JDBC and Multithreading
- C.2 Performance Optimization of JDBC Programs
- C.3 Transaction Isolation Levels and Access Modes in JDBC
- D JDBC Error Messages
-
E
Troubleshooting
-
E.1
Common Problems
- E.1.1 Memory Consumption for CHAR Columns Defined as OUT or IN/OUT Variables
- E.1.2 Memory Leaks and Running Out of Cursors
- E.1.3 Opening More than 16 OCI Connections for a Process
- E.1.4 Using statement.cancel
- E.1.5 Using JDBC with Firewalls
- E.1.6 Frequent Abrupt Disconnection from Server
- E.1.7 Network Adapter Cannot Establish Connection
- E.2 Basic Debugging Procedures
-
E.1
Common Problems
- Index