Install MariaDB Connector/J

Overview

MariaDB Connector/J is usually installed using Maven or by manually downloading the JAR file.

Install MariaDB Connector/J via JAR

To download the JAR file manually:

  1. Go to the MariaDB Connector/J download page

  2. Within the "Product" dropdown, choose the "Java 8+ connector" or "Java 7 connector".

  3. In the "Version" dropdown, choose the desired version.

  4. Click the "Download" button to download the JAR file.

  5. When the JAR file finishes downloading, place it into the relevant directory on your system.

  6. Similarly, install dependency JAR files, if any used.

Install MariaDB Connector/J via Maven

Maven can install MariaDB Connector/J as a dependency of your application during build. Set the <version> element to correspond to the version of MariaDB Connector/J that you would like to install.

To use Maven to install MariaDB Connector/J, add the dependency to your pom.xml file:

<dependency>
   <groupId>org.mariadb.jdbc</groupId>
   <artifactId>mariadb-java-client</artifactId>
   <version>3.3.3</version>
</dependency>

For additional information on available releases, see the "Release Notes for MariaDB Connector/JRelease Notes for MariaDB Connector/J".

Depending on the features you plan to use, you may need to add some additional dependencies to pom.xml.

To use connection pools with commons-dbcp2 from Apache Commons, add the following dependency to your pom.xml file:

<dependency>
   <groupId>org.apache.commons</groupId>
   <artifactId>commons-dbcp2</artifactId>
   <version>3.3.3</version>
</dependency>