For the complete documentation index, see llms.txt. This page is also available as Markdown.

Connector/J

Explore MariaDB Connector/J, the official JDBC driver for Java applications to connect to MariaDB and MySQL databases.

MariaDB Connector/J is the official JDBC driver for connecting Java applications to MariaDB and MySQL databases. It is LGPL licensed.

MariaDB Connector/J guide: JDBC driver reference covering connections, prepared statements, and transactions, plus Java version compatibility.

Failover and load balancing in MariaDB Connector/J 2.x support sequential, loadbalance, replication, and aurora modes across multi-master, master-slave, and Amazon Aurora clusters.

MariaDB Connector/J 3.0 and later support failover and high availability through sequential, loadbalance, replication, and load-balance-read modes with optional transaction replay.

MariaDB Connector/J supports GSSAPI authentication via the server gssapi plugin, using JAAS on Unix or a Waffle-based native Windows implementation for Kerberos ticket validation.

Install MariaDB Connector/J with a package manager (Maven or Gradle) or manually from the downloaded JAR file.

Add MariaDB Connector/J to a Gradle project by declaring the mariadb-java-client dependency in build.gradle, then connect to MariaDB using standard JDBC DriverManager methods.

Add MariaDB Connector/J to a Maven project by declaring the mariadb-java-client dependency in pom.xml, then connect to MariaDB using standard JDBC DriverManager methods.

useBatchMultiSend enables bulk batch execution in MariaDB Connector/J, grouping executeBatch calls into multi-query packets to reduce round-trips between client and server.

MariaDB Connector/J provides MariaDbDataSource and MariaDbPoolDataSource implementations with configurable pool size, idle timeout, validation delay, and JMX monitoring support.

Configure TLS and SSL for MariaDB Connector/J using sslMode, serverSslCert, and keyStore options, supporting trust, verify-ca, verify-full, and zero-configuration encryption modes.

This page is: Copyright © 2026 MariaDB. All rights reserved.

Last updated

Was this helpful?