Oracle JDBC Drivers 19c, 21c, 23ai

Loïc Lefèvre
db-one
Published in
3 min readMar 9, 2023

--

Last updated: 2024.05.06

Sometimes, you need information about Oracle JDBC drivers, such as the last versions, which one to use for a given database version, the changelogs, etc.

In this post, I tried to bring you all this information in one place. If anything is missing, don’t hesitate to comment so that I can fix it. This is not a read-only post!

There are currently 3 major versions of these drivers being supported:

  • 19.X.X.X known as Long Term Support (or LTS); latest version: 19.22.0.0; end of extended support is April 2027
  • 21.X.X.X known as Innovation Release; latest version: 21.13.0.0; end of support is April 2025
  • 23.X.X.YY.MM known as Long Term Support; latest version: 23.4.0.24.05 brought along the new Oracle Database 23ai FREE.

The changelogs of these versions can be found respectively here for 19, here for 21, and here for 23ai.

These drivers come in 2 flavors:

  • thin: Level 4 driver 100% written in Java, useful for GraalVM native images, available on Maven Central, e.g.:

Maven dependencies:

<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<version>19.22.0.0</version>
</dependency>
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<version>21.13.0.0</version>
</dependency>
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc11</artifactId>
<version>23.4.0.24.05</version>
</dependency>

Gradle short dependencies:

implementation 'com.oracle.database.jdbc:ojdbc8:19.22.0.0'
implementation 'com.oracle.database.jdbc:ojdbc8:21.13.0.0'
implementation 'com.oracle.database.jdbc:ojdbc11:23.4.0.24.05'
  • thick: Level 2 driver which requires the previously mentioned Java dependencies along additional libraries such as the Oracle Instant Client; not really good for Container images (larger size)

A good place to get the latest information is the official Oracle JDBC FAQ portal!

One of the questions you may ask yourself is which driver should I use for a given database version and a given JVM version. From the FAQ above, it looks like relying on the ojdbc8.jar is the best choice for now as it remains compatible with JDK 8 and JDK 11 as well as Oracle databases 19c and 21c while it’s compliant with JDBC 4.2 specification.

For JDK 17 and above, you should use the ojdbc11.jar, also it is JDBC 4.3 compliant.

From the FAQ, this means:

If you are using JDK11 then, ojdbc8.jar is still a better choice as it includes all the 4.3 features but as Oracle extensions. Customers can use ojdbc10.jar only if they need JDBC 4.3 features available through standard Java SE.
Example:
ojdbc8.jar:

Connection conn = DriverManager.getConnection(...);    
// would fail because beginRequest is not in Java 8
conn.beginRequest();

// succeeds because beginRequest is provided as an Oracle extension
((OracleConnection)conn).beginRequest();

ojdbc10.jar:

Connection conn = DriverManager.getConnection(...);    
// succeeds because beginRequest is in Java 10
conn.beginRequest();

// succeeds because OracleConnection supports JDBC 4.3 (in Java 10)
// and beginRequest is part of JDBC 4.3
((OracleConnection)conn).beginRequest();

A quick note regarding the Oracle Database 23ai, JDBC 19 driver is currently the minimum planned version to support this Long Term Support (LTS) release.

Since the beginning of May 2024, with the new Oracle Database 23ai FREE announcement, 23ai JDBC drivers are now available on OTN and on Maven Central.

You can learn more about all the new features here (focus on 1 new feature each week). Finally, Kuassi has a great post about the JDBC-specific new features here:

  • Pipelined Database Operations
  • JSON-Relational Duality Views
  • JDBC Self-Driven Diagnosability
  • Native Boolean Datatype support
  • Token-based authentication (Azure AD, OCI IAM)
  • RADIUS authentication
  • TLS1.3 support
  • and more!!!

Last but not least, I recommend the following documentation:

And don’t forget to read this note if you’re connecting to an Autonomous database.

--

--