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
Expand allCollapse all- Whats New in 26ai?
- Are there any Oracle Database Cloud Service related documents for Java developers?
JDBC in General
Expand AllCollapse All- What is JDBC?
- Where can I learn more about JDBC?
- Where can I learn more about Java?
Release | GA Date | Premier Support Ends | Extended Support Ends | Sustaining Support Ends |
|---|---|---|---|---|
| 26ai | Jan 2026 |
| Dec 2031 | Indefinite |
| 21c (Innovation Release) | Aug 2021 | Jul 2027 | Not Available | Indefinite |
| 19c (Long Term Release) | Apr 2019 | Dec 2029 (Refer Lifetime Support Policy) | Dec 2032 | Indefinite |
| 18c | Jul 2018 | Jun 2021 | Not Available | Indefinite |
| 12.2 | Mar 2017 | Nov 30, 2020 (Limited Error Correction Period for 12.2.0.1 - Dec 1, 2020 - Mar 31, 2022) | Not Available | Indefinite |
| EE 12.1 | Jun 2013 | Jul 2018 | Jul 2022 | Indefinite |
Interoperability Matrix | Database 23.x | Database 21.x | Database 19.x | Database 18.3 | Database 12.2 and 12.1 |
|---|---|---|---|---|---|
| JDBC 23.x | Yes | Yes | Yes | No | No |
| JDBC 21.x | Yes | Yes | Yes | Was | Was |
| JDBC 19.x | Yes | Yes | Yes | Was | Was |
| JDBC 18.x | No | Was | Was | Was | Was |
| JDBC 12.2 and 12.1 | No | Was | Was | Was | Was |
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.x | ojdbc8.jar with JDK8 and JDK11 |
| 12.2 or 12cR2 | ojdbc8.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 |
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.3 | JDBC 4.2 in ojdbc8.jar |
| 12.2 or 12cR2 | JDBC 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
Expand allCollapse all- 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
Expand allCollapse all- 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
Expand allCollapse all- 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
Expand allCollapse all- What is the difference between the DriverManager and a DataSource?
- Which connection pool should I use?
- What is JDBC OCI Connection Pooling?
Connections
Expand allCollapse all- 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 |
|---|---|---|---|---|---|---|
| All | All | All | 0 | 0 | Null | |
| All | SQL | Client | 1 char | 32766 chars | Direct | |
| All | SQL | Client | 32767 chars | 2147483647 bytes | Stream | |
| All | SQL | Client | 2147483648 bytes | 2147483647 chars | Temp Clob | |
| CHAR | | Server | 1 Char | 65536 bytes | Direct | 1, 2 |
| NCHAR | | | 1 Char | 4000 bytes | Direct | |
| NCHAR | | | 4001 bytes | 2147483647 chars | Temp Clob | |
| CHAR | | | 65537 bytes | 2147483647 chars | Stream | |
| | | | 2147483647 bytes | 2147483647 chars | Temp Clob |
| All | PL/SQL | All | 1 char | 32512 chars | Direct | |
| All | PL/SQL | All | 32512 chars | 2147483647 chars | Temp Clob |
API | FORM | Stmt | Driver | Lower Limit | Upper Limit | Bind mechanism | Note |
|---|---|---|---|---|---|---|---|
| setBytesForBlob | n/a | All | All | 0 | 0 | Null | |
| | | All | Client | 1 byte | 2000 bytes | Direct | |
| | | All | Client | 2001 bytes | 21474836487 bytes | Temp blob | 2 |
| setStringForClob | All | All | All | 0 | 0 | Null | |
| | All | All | Client | 1 char | 32766 chars | Direct | |
| | All | All | Client | 32766 chars | 2147483647 chars | Temp clob | |
| | All | All | Server | 1 char | 4000 bytes | Direct | |
| | All | All | Server | 4001 bytes | 2147483647 chars | Temp clob | 1 |
Expand allCollapse all
- 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
Expand allCollapse all- What does "Exhausted Resultset: prepare_for_new_get" mean?
- Why do I have to close ResultSets?
Simple Data Types
Expand allCollapse all- What is going on with DATE and TIMESTAMP?
- What is the longest value I can bind?
Method | Column Type | Maximum Length |
|---|---|---|
setBytes | LONG | 4k bytes |
setBytes | LONG RAW | 2G bytes |
setString | LONG | 32k chars( |
setString |
| 2G chars |
Expand allCollapse all
- Why is the result of reading a TIMESTAMP WITH TIME ZONE different?
Advanced Data Types (Objects)
Expand allCollapse all- How should I create instances of ADTs?
- Why isn't the standard factory method createArrayOf supported?
BFILEs, BLOBs, CLOBs
Expand allCollapse all- 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
Expand allCollapse all- 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
Expand allCollapse all- What are OPAQUE types?
Row Sources
Expand allCollapse all- 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
Expand allCollapse all- Can the Thin JDBC Driver be used to develop Java applications?
Server Internal Driver
Expand allCollapse all- When should I use the Server Internal Driver?
Server Thin Driver
Expand allCollapse all- When should I use the Server Thin Driver?
Errors
Expand allCollapse all- 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
Expand allCollapse all- 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
Expand allCollapse all- 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
Expand allCollapse all- Can I debug JDBC programs with Symantec Visual Cafe?
- Can I debug JDBC programs with Microsoft's Visual J++?
Supported Features
Expand allCollapse all- 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
Expand allCollapse all- Which is faster, the Thin driver or the OCI driver?
- Which is faster, Statements or PreparedStatements?
java.util.logging
Expand allCollapse all- 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?