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> 0Just add the MySQL dependency in pom.xml files
<dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.24</version> </dependency> 2