Oracle JDBC Frequently Asked Questions (FAQ)

This FAQ contains answers to the most frequently asked questions about Oracle's JDBC drivers. Note that this FAQ addresses specific technical questions only and also cover known problems. Refer to the JDBC Developer's Guide and Javadoc for JDBC for more details about the features and how those features can be used in your application. 


Frequently Asked Questions

    • Whats New in 26ai?
    • Are there any Oracle Database Cloud Service related documents for Java developers?

JDBC in General

Release Specific Questions

    • Which version of JDBC drivers are supported ?

Release

GA Date

Premier Support Ends

Extended Support Ends

Sustaining Support Ends

26aiJan 2026
  • Dec 2031
Dec 2031Indefinite
21c (Innovation Release)Aug 2021Jul 2027Not AvailableIndefinite
19c (Long Term Release)Apr 2019Dec 2029 (Refer Lifetime Support Policy) Dec 2032Indefinite
18cJul 2018Jun 2021Not AvailableIndefinite
12.2Mar 2017Nov 30, 2020 (Limited Error Correction Period for 12.2.0.1 - Dec 1, 2020 - Mar 31, 2022)Not AvailableIndefinite
EE 12.1Jun 2013Jul 2018Jul 2022Indefinite

    • What is the JDBC and RDBMS interoperability matrix or the certification matrix?

Interoperability Matrix

Database 23.x

Database 21.x

Database 19.x

Database 18.3

Database 12.2 and 12.1

JDBC 23.xYesYesYesNoNo
JDBC 21.xYesYesYesWasWas
JDBC 19.xYesYesYesWasWas
JDBC 18.xNoWasWasWasWas
JDBC 12.2 and 12.1NoWasWasWasWas

    • What are the Oracle JDBC releases Vs JDK versions?

Oracle Database version

JDBC Jar files specific to the release

23.x

ojdbc17.jar with JDK17, JDK19,  JDK21, and JDK25 with Jakarta APIs support


ojdbc11.jar with JDK11 and JDK21


ojdbc8.jar with JDK8 and JDK11

21.x

ojdbc11.jar with JDK11, JDK17, JDK19, and JDK21


ojdbc8.jar with JDK8 and JDK11

19.x

ojdbc10.jar with JDK11, JDK17, JDK19, and JDK21 (19.25 onwards)


ojdbc8.jar with JDK8, JDK11, JDK17, JDK19, and JDK21 (19.25 onwards)

18.xojdbc8.jar with JDK8 and JDK11
12.2 or 12cR2ojdbc8.jar with JDK 8
12.1 or 12cR1

ojdbc7.jar with JDK 7 and JDK 8


ojdbc6.jar with JDK 6

11.2 or 11gR2

ojdbc6.jar with JDK 6, JDK 7, and JDK 8


(Note: JDK7 and JDK8 are supported in 11.2.0.3 and 11.2.0.4 only)


ojdbc5.jar with JDK 5

    • What are the Oracle JDBC releases Vs JDBC specifications?

Oracle Database version

JDBC specification compliance

23.x and 21.x

JDBC 4.3 in ojdbc11.jar


JDBC 4.2 in ojdbc8.jar

19.x

JDBC 4.3 in ojdbc10.jar


JDBC 4.2 in ojdbc8.jar

18.3JDBC 4.2 in ojdbc8.jar
12.2 or 12cR2JDBC 4.2 in ojdbc8.jar
12.1 or 12cR1

JDBC 4.1 in ojdbc7.jar


JDBC 4.0 in ojdbc6.jar

11.2 or 11gR2

JDBC 4.0 in ojdbc6.jar


JDBC 3.0 in ojdbc5.jar

Additional Release Specific Questions

    • Are the Oracle JDBC drivers certified against OpenJDK?
    • What is the recommended 19.x JDBC driver to be used with JDK11?
    • What about the JDBC version which are not listed in the above table?
    • Where can I get the JDBC jar files?
    • What are the different JAR files on the 19.x JDBC driver download page for?

Oracle JDBC in General

    • What are the different JDBC drivers that Oracle provide?
    • Which driver should I use?
    • What about the Jars for the Server Thin Driver and the Server Internal Driver?
    • Can third party vendors distribute Oracle's JDBC drivers along with their own software?
    • What permissions do the Oracle JDBC drivers require?

Installation

    • How do I install the Thin driver?
    • How do I install the OCI driver?
    • How do I install the Server-Side Internal driver or the Thin in the server driver?

DriverManager and DataSources

    • What is the difference between the DriverManager and a DataSource?
    • Which connection pool should I use?
    • What is JDBC OCI Connection Pooling?

Connections

    • What is the form of a URL?
    • What is the form of the description?
    • How do I use the Properties argument?
    • Don't I have to register the class OracleDriver with the DriverManager?
    • What username and password should I use when connecting to the Server Internal Driver?
    • I'm getting OutofMemory Error when I set a higher default prefetch value.
    • What is a service connect string?
    • How do I connect as SYSDBA or SYSOPER?
    • What encryption methods are supported by the Oracle JDBC drivers?
    • How do I turn on encryption and checksumming with the JDBC Thin driver?
    • What is proxy authentication?
    • Do Oracle JDBC drivers support SSL?
    • Do the Oracle JDBC drivers support LDAP in the connection URL?
    • How can I use JDBC to connect to a database server behind a firewall?
  • Statements, PreparedStatements, CallableStatements

    • What is defineColumnType and when should I use it?
    • Does defineColumnType force conversions on the Server?
    • How to turn off EscapeProcessing at the jdbc driver level instead of calling stmt.setEscapeProcessing(false) in application code?
    • Do the Oracle JDBC drivers provided a Bind by Name facility?
    • For setXXX methods in PreparedStatement how do the Oracle JDBC drivers determine the data type?
    • What happens if the type of the target parameter is not the same as the type assumed by the setXXX method?
    • Why do not the drivers do the conversion on the client side?
    • For inserting into a column in a table what are the byte data types?
    • For inserting into a column in a table what are the character data types?
    • What are the sizes for the setString, setCharacterStream, and setAsciiStream and size limits for binary data via setBytes and setBinaryStream?

Form

Stmt

Driver

Lower Limit

Upper Limit

Bind mechanism

Note

AllAllAll00Null
AllSQLClient1 char32766 charsDirect
AllSQLClient32767 chars2147483647 bytesStream
AllSQLClient2147483648 bytes2147483647 chars

Temp Clob


CHAR 
Server1 Char65536 bytes

Direct


1, 2


NCHAR 
 
1 Char4000 bytes

Direct


NCHAR 
 
4001 bytes2147483647 chars

Temp Clob


CHAR 
 
65537 bytes2147483647 chars

Stream


 
 
 
2147483647 bytes2147483647 chars

Temp Clob


AllPL/SQLAll1 char32512 charsDirect 
AllPL/SQLAll32512 chars2147483647 charsTemp Clob

    • What are the size limits for the proprietary methods setBytesForBlob, setStringForClob in oracle.jdbc.OraclePreparedStatement?

API

FORM

Stmt

Driver

Lower Limit

Upper Limit

Bind mechanism

Note

setBytesForBlob

n/a


AllAll

0


0


Null
 
 
AllClient1 byte

2000 bytes


Direct
 
 
AllClient2001 bytes21474836487 bytesTemp blob2
setStringForClob

All


AllAll00Null 
 

All


AllClient1 char32766 charsDirect 
 

All


AllClient32766 chars2147483647 charsTemp clob 
 

All


AllServer1 char4000 bytesDirect 
 

All


AllServer4001 bytes2147483647 charsTemp clob1

    • Does switching bind types force additional server side parsing of the statement?
    • What about CallableStatements and procedures with IN OUT parameters?
    • Will the selection of polymorphic PL/SQL procedures change when the bind type changes?
    • What about existing code?
    • For certain cases the driver is creating temporary lobs. Does it track these and free them?
    • We are using a variable width character set such as UTF8. Does the driver correct for the actual byte length of a sequence of characters?
    • Is it a good idea to use e.g. setString for a really huge string?
    • LONG RAW and LONG column types are deprecated. Why are there new uses of the setXXXStream API's?
    • The LOB API's are much more flexible, right?
    • Why can't I create a PreparedStatement that does select * from tab where id in (?, ?, ?, ...)?

ResultSets

    • What does "Exhausted Resultset: prepare_for_new_get" mean?
    • Why do I have to close ResultSets?

Simple Data Types

    • What is going on with DATE and TIMESTAMP?
    • What is the longest value I can bind?

Method

Column Type

Maximum Length

setBytesLONG

4k bytes


setBytesLONG RAW

2G bytes


setStringLONG

32k chars(SetBigStringTryClob="false")
4k chars (SetBigStringTryClob="true")


setString

CLOB


2G chars


    • Why is the result of reading a TIMESTAMP WITH TIME ZONE different?

Advanced Data Types (Objects)

    • How should I create instances of ADTs?
    • Why isn't the standard factory method createArrayOf supported?

BFILEs, BLOBs, CLOBs

    • What is DBMS_LOB.ERASE doing?
    • Can I use oracle.sql.CLOB.putChars()?
    • OCI provides function to manipulate a CLOB CharSetId. What is the JDBC equivalent?
    • Is writing into BLOBS is slower than inserting LONG RAWs ?
    • Why am I getting an ORA-03127 error when getting the LobLength in the Stream sample code?
    • When I get a CLOB from the database and then update it, sometimes my changes don't appear in the database. Why?

REF types

    • How can I pass an oracle.sql.REF between two different JDBC clients (EJBs, JDBC Clients, etc.)? As the REF class is not serializable?
    • How can I create a new REF?

OPAQUE types

    • What are OPAQUE types?

Row Sources

    • When I set the scrollability attribute after execute, it does not have any effect on the scrollability of the RowSet. Why?
    • Can I serialize the RowSet object to a flat file even if the RowSet contains streams?

Thin Driver

    • Can the Thin JDBC Driver be used to develop Java applications?

Server Internal Driver

    • When should I use the Server Internal Driver?

Server Thin Driver

    • When should I use the Server Thin Driver?

Errors

    • DriverManager.getConnection gives the Error: "No suitable driver"
    • Error Message: "UnsatisfiedLinkError with OCI driver"
    • Error Message: "ORA-1019: unable to allocate memory."
    • Error Message: "ORA-01000: maximum open cursors exceeded"
    • Error Message: "ORA-01002: fetch out of sequence"
    • Error Message: "ORA-12705: invalid or unknown NLS parameter value specified"
    • Error While Trying to Retrieve Text for Error ORA-12705.
    • Error Message: The JDBC Thin Driver Gives Me "invalid character" Errors for Unicode Literals
    • INSERT or UPDATE operations are slow
    • Error Message: "Connection reset by peer"
    • What does "Protocol Violation" mean?

Demo Programs

    • Are there any JDBC demo programs?
    • How do I run the demos?
    • What should I do when error happens when I run a demo?

Oracle JDBC Trace Facility

    • What is the JDBC Trace Facility?
    • How do I turn on the old JDBC trace?
    • How do I control the volume of trace output?
    • Where does the trace output go?
    • How can I turn off DMS in a DMS enabled jar?

Development Tools and Environments

    • Can I debug JDBC programs with Symantec Visual Cafe?
    • Can I debug JDBC programs with Microsoft's Visual J++?

Supported Features

    • Can the JDBC Drivers access PL/SQL Stored Procedures?
    • Do the JDBC Drivers support streaming?
    • Do the JDBC Drivers support multibyte character sets?
    • Do the JDBC Drivers work with firewalls?
    • Do Oracle's JDBC drivers support PL/SQL tables/result sets/records/booleans?
    • Is failover supported?
    • How do the JDBC drivers support Oracle ROWID datatypes? What does this have to do with getCursorName and setCursorName?
    • How do the JDBC drivers support Oracle REFCURSOR datatypes?
    • Does ANO work with JDBC drivers?
    • Can I serialize oracle.sql.* datatypes?
    • Do the JDBC Drivers support Objects or Collections?
    • Can I use WaitOption and AutoRollback?
    • Can a Java Stored Procedure in one database instance open a connection to another database instance?

Performance

    • Which is faster, the Thin driver or the OCI driver?
    • Which is faster, Statements or PreparedStatements?

java.util.logging

    • How do I use java.util.logging to get trace output from the Oracle JDBC drivers?
    • How do I configure java.util.logging to get useful trace output from Oracle JDBC?
    • What about the Server-Side Internal driver?