DEV Community

NDONGO TONUX SAMB
NDONGO TONUX SAMB

Posted on • Edited on

1

How to add an Oracle JDBC driver to your maven repository

We are going to see how to add an Oracle JDBC driver in your local Maven repository and how to reference it in your pom.xml.

Download the Oracle JDBC driver

link : https://www.oracle.com/database/technologies/jdbcdriver-ucp-downloads.html

You have to go to the Oracle site to get the Oracle JDBC driver. Choose the right version of the jar. Example ojdbc6.jar or ojdbc7.jar

Settling in Maven

To install the Oracle jdbc drivers you have to go to the terminal and put the following command:

mvn install:install-file -Dfile={Path/to/your/ojdbc6.jar}
  -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0 -Dpackaging=jar
Enter fullscreen mode Exit fullscreen mode

Setting the pom.xml

In your pom add now the dependency :

<dependencies>        ...
    <!-- ojdbc6.jar example -->
    <dependency>
        <groupId>com.oracle</groupId>
        <artifactId>ojdbc6</artifactId>
        <version>11.2.0</version>
    </dependency>

    ...

</dependencies>
Enter fullscreen mode Exit fullscreen mode

NB : Note that for the jar ojdbc7.jar the version in the pom becomes
12.1.0

Takk Jokk

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more