How Can I Obtain Mysql Connector Java Maven Dependency

I have downloaded MySQL Workbench for my database, and IntelliJ for the JDBC. However, while watching a tutorial, it was mentioned that I need the MySQL dependency in a pom.xml file. Any idea on how to obtain that?

2 Answers

To connect to a MySQL database server from a Java app, you need a JDBC driver. The MySQL Connector/J product is one such JDBC driver.

You can obtain MySQL Connector/J via Maven. Look at a Maven repository for the <dependency> XML fragment. Copy-paste that within the <dependencies> tag of your POM file.

For example, look at MvnRepository.com.

<!--  -->
<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>8.0.24</version>
</dependency>
0

Just add the MySQL dependency in pom.xml files

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>8.0.24</version>
</dependency>
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest