Connect From Java App
MariaDB Connector/J enables Java applications to connect to MariaDB Cloud using a native MariaDB connector.
Install MariaDB Connector/J via JAR
To download the JAR file manually:
Go to the MariaDB Connector/J download page
Within the "Product" dropdown, choose the "Java 8+ connector".
In the "Version" dropdown, choose the desired version.
Click the "Download" button to download the JAR file.
When the JAR file finishes downloading, place it into the relevant directory on your system.
Similarly, install dependency JAR files, if any are 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.4.1</version>
</dependency>For additional information on available releases, see the "Release Notes for MariaDB Connector/J".
Depending on the features you plan to use, you may need to add some additional dependencies to pom.xml.
If you downloaded the connector JAR, place it on your CLASSPATH
Connector/J 3.0
In MariaDB Connector/J 3.0, TLS is enabled for connections to MariaDB Cloud using the sslMode parameter.
Connector/J 2.7
In MariaDB Connector/J 2.7 and before, TLS is enabled for connections to MariaDB Cloud using the useSsl parameter.
Last updated
Was this helpful?

