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

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like