What’s New in MariaDB Connector/J 2.2 and 1.7


We are pleased to announce the general availability (GA) of MariaDB Connector/J 2.2 and 1.7, the newest versions of MariaDB Connector/J.

As both new versions are fully compatible to their corresponding latest maintenance releases to support Java 6/7 and Java 8+, version 2.1.2 and 1.6.5 are the last maintenance releases for 2.1 and 1.6.

New enhancements include:

Pool Datasource

There are now two different Datasources implementations:

  • MariaDbDataSource: The existing basic implementation. A new connection each time the getConnection() method is called.
  • MariaDbPoolDataSource: Connection pooling implementation. MariaDB Driver will keep a pool of connections and borrow connections when asked for it.

Good framework already exists that can accomplish this job such as DBCP2, HikariCP, C3P0, apache, so why have another implementation? Here are some of the reasons:

  • Reliability: When reusing a connection from pool, the connection must be like a “new freshly created” connection. Depending on connection state, frameworks may result executing multiple commands to reset state (Some frameworks even choose to skip some of those reset to avoid some performance impact). MariaDB has a dedicated command to refresh connection state permitting real reset (rollback remaining transaction, reset transaction isolation level, reset session variables, delete user variables, remove all PREPARE statement, …) in one command.
  • Performance: The pool can save some information at the first connection, allowing faster creations when making the next connection.
  • Easy configuration: Solve some frequent issues, like server will close socket if not used after some time (wait_timeout default to 8h). Pool implementation avoids keeping a connection in a bad state.

The pool is implemented at connection level, which allows using pool for a particular use case by enabling pool using the connection string: “jdbc:mariadb://host/db?pool=true”.

Configuration example using Spring:

public class DatabaseConfig {

    private String DB_PASSWORD;

    private String DB_URL;

    private String DB_USERNAME;

    public DataSource dataSource() throws SQLException {
        MariaDbPoolDataSource dataSource = new MariaDbPoolDataSource();
        return dataSource;


Download the MariaDB Connector now and learn about the newest evolution of MariaDB Connector/J.


Download Release Notes Knowledge Base