You can also use Maven dependencies manager to install and configure the Connector/J library in your project. Connector/J is published in The Maven Central Repository with the following groupId and artifactId:
groupId:
com.mysql
artifactId:
mysql-connector-j
You can link the Connector/J library to your project by adding
the following dependency in your pom.xml
file:
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>x.y.z</version>
</dependency>
Notice that if you use Maven to manage your project
dependencies, you do not need to explicitly refer to the library
protobuf-java
as it is resolved by dependency
transitivity. However, if you do not want
to use the X DevAPI features, you may also want to add a
dependency exclusion to avoid linking the unneeded sub-library.
For example:
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>x.y.z</version>
<exclusions>
<exclusion>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</exclusion>
</exclusions>
</dependency>