The recommended way to install MariaDB Connector/J is to use a package manager like or .
To install MariaDB Connector/J with , add the following dependency to your pom.xml configuration file:
Ensure to replace the $VERSION with a valid MariaDB Connector/J version number. See to determine which MariaDB Connector/J release series supports your Java version.
To install MariaDB Connector/J with , add the following dependency to your build.gradle configuration file:
Ensure to replace the $VERSION with a valid MariaDB Connector/J version number. See to determine which MariaDB Connector/J release series supports your Java version.
.
It is not generally the recommended method, but MariaDB Connector/J can also be installed by manually installing the .jar file to a directory in your . MariaDB Connector/J .jar files can be downloaded from the following URL:
This section deals with building the connector from the source and testing it. If you have downloaded a ready-built connector in the package as a jar file, then this section may be skipped.
The source code is available at the on GitHub. You can clone it by executing the following:
If you would prefer a packaged source tarball release, then MariaDB Connector/J .jar source code tarballs can be downloaded from the following URL:
MariaDB Connector/J has the following build requirements:
Java JDK
If you would like to run the unit tests, then you'll need a MariaDB or MySQL server. It has to meet the following requirements:
It must be listening on localhost a TCP port 3306.
It must have a database called testj.
It must have a root user account with an empty password.
If you would like to build MariaDB Connector/J and run the unit tests, then execute the following:
If you would like to build MariaDB Connector/J without running the unit tests, then execute the following:
Once the build is complete, you should have a .jar file with a name like the one mariadb-java-client-x.y.z.jar in the target subdirectory.
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>$VERSION</version>
</dependency>implementation 'org.mariadb.jdbc:mariadb-java-client:$VERSION'git clone https://github.com/MariaDB/mariadb-connector-j.gitmvn packagemvn -Dmaven.test.skip=true package