Release Notes for MariaDB Connector/J 3.1.0

Overview

MariaDB Connector/J is a lightweight JDBC driver (Type 4) for building applications on top of MariaDB database products with Java 8, Java 11, and Java 17.

This release is compatible with JDBC 4.2.

MariaDB Connector/J 3.1.0 was released on 2022-11-15. This release is of General Availability (GA) maturity.

Notable Changes

  • Improved load distribution in configurations with multiple servers with load balancing enabled. (CONJ-992)

    • Starting with this release, nodes are chosen using a round robin algorithm to evenly distribute the load.

  • Performance improvements when pipelining on a remote server. (CONJ-1015)

    • Starting with this release, pipelining writes a single byte array of multiple packets to the socket, which allows both PREPARE and EXECUTE commands to be placed in the same buffer, and allows two database packets to be combined into a single TCP/IP packet.

  • Improved performance when dealing with large result-sets due to changes in processing each decode. (CONJ-1009)

    • Starting with this release, the value decoding method is set depending on the data type.

    • In previous releases, the column metadata is checked to get the column's data type, signed/unsigned attribute, and other options for each decode.

  • Improved performance when dealing with large result-sets due to changes in packet handling. (CONJ-1014)

    • Starting with this release, the parser uses a cache buffer to combine multiple received packets into a single byte array.

    • In previous releases, each database packet received requires a byte array to be created.

UUID Object Support

  • Starting with this release, the ResultSet.getObject method, without class or type precision, returns a UUID object for the UUID object's fields by default.

    • The feature uses the UUID data format introduced in MariaDB Community Server 10.7, which allows both the getter and the setter to pass the java.util.UUID parameter, for example: PrepareStatement setObject(int column, <UUID Object>) or ResultSet getObject(int column, UUID.class).

  • Starting with this release, the following metadata is returned for the corresponding fields of the UUID object:

    The ResultSetMetaData Object's Field

    Metadata (version 3.1.0+)

    Metadata (version <3.1.0)

    getColumnTypeName(int column)

    uuid

    CHAR

    getColumnClassName(int column)

    java.util.UUID

    java.lang.String

    getColumnType(int column)

    Types.OTHER

    Types.CHAR

  • For compatibility purposes, the uuidAsString option has been added to treat the UUID object as a String (as it was prior to this release).

Changed Defaults

  • The default value for the useReadAheadInput socket option has changed to false. (CONJ-1008)