The core Oracle JDBC drivers jar i.e., ojdbc8.jar can be used in isolation however, depending on the use cases such as connection pooling, high availability, connectivity to database cloud services, NLS, and so on, additional jars are required. Figuring out which artifacts are needed for such-and-such use case, could be mind boggling.
In the previous packaging of our drivers on Maven Central, we’ve pre-established dependencies between the artifacts required for the most common use cases. Java developers familiar with Maven have been excluding the un-wanted artifacts however, some of you told us that you’d prefer to pick and choose what you need and not go through the exclusion process.
In this release, and going forward, we are giving you a choice between “pick-and-choose” and “pre-established” dependencies. There is no change in our Maven coordinates.
Starting with this release (220.127.116.11), each artifact is completely independent and does not drag any other. What is the list and purpose of the 18.104.22.168 artifacts on Maven Central?
The complete list of all artifacts, as of the 22.214.171.124 release.
Here is a summary description of each artifact (description also available in its corresponding pom.xml).
1) The core artifacts, only one at a time, cannot be mixed, are: ojdbc8, ojdbc8_g, ojdbc8dms, ojdbc8dms_g, ojdbc10, ojdbc10_g, ojdbc10dms and ojdbc10dms_g
2) The companion artifacts, may be used with any of the core artifacts, are: ucp, oraclepki, osdt_core, osdt_cert, ons, simplefan, xdb, xmlparserv2, orai18n and dms
In your project pom.xml, you can pull the corresponding jar(s) by configuring <dependencyManagement> and a <dependencies> blocks as illustrated in the following Gist file.
The "DIY using the BOM" tab of the developers guide to Oracle JDBC with Maven has a set of use case based recipes that you can copy/paste.
For those who just want the required artifacts for all database use cases, we have provisioned a set of pre-defined dependencies for production, production with observability instrumentation, debugging, and debugging with observability instrumentation.
The following artifactIds pull all the jars you would need for all Oracle database use cases:
ojdbc8-production, ojdbc8-debug, ojdbc8-observability, ojdbc8-observability-debug: these artifactIds support the JDBC 4.2 Spec for use with JDK 8, 9, and 11.
ojdbc10-production, ojdbc10-debug, ojdbc10-observability, ojdbc10-observability-debug: these artifactIds support the JDBC 4.3 for use with JDK 10 and 11.
Example: I want to pull the production jars
All you need is to add the following dependency to your project’s pom.xml under the <dependencies> block
The "Pre-established Dependencies" tab of the developer guide for Oracle JDBC with Maven has examples of the dependencies to use for pulling the production jars (see the example above), the production jars with observability instrumentation, the debugging jars, and the debug jars with observability instrumentation.
As we introduce new capabilities into the drivers and companion jars, we will be announcing these through @kmensah.