Search code examples
javaintellij-ideajdbcidelibraries

Installing JDBC on java 11


I need to update a program from Java 8 to Java 11 for the upcoming EOL, the program has moved over with no issue. The issue is that it relies on the JDBC driver that was originally placed inside the JRE folder. Java 11 does not have this folder so how do you install it?

I am using the IntelliJ community edition IDE, and using AdoptOpenJDK-11. I am attempting to connect to a MySQL database(8.0.20 CommunityServer) and trying to use Connector/J 8.0.20 from https://dev.mysql.com/downloads/connector/j/


Solution

  • You have to add it manually and this depends of your database, you have two ways:

    1. If you are using maven or gradle, then add the dependency in the pom.xml or build.gradle
    2. If you are use the old way(which is not recommended) then add the jdbc jar in the lib folder.

    Fore more details read this: Oracle JDBC FAQ