MySQL Blog Archive
For the latest blogs go to blogs.oracle.com/mysql
MySQL Connector/J 5.1.37 has been released

I’m pleased to announce: MySQL Connector/J 5.1.37 Maintenance Release is now available.

MySQL Connector/J can be downloaded from the official distribution channels MySQL Downloads and The Central repository. Commercial license version is available for download at My Oracle Support.

As always, we recommend that you check the “CHANGES” file in the
download archive and/or the release notes to be aware of changes in behavior that might affect your application.

MySQL Connector/J 5.1.37 includes several bug fixes and other improvements. I’d like to highlight just a few:

Support for JDBC 4.2

Connector/J now provides implementations for pretty much all new JDBC 4.2 methods, namely for large update counts and max rows support.

The other big change is the support for the new temporal classes from java.time package. LocalDate, LocalDateTime, LocalTime are fully supported and can now be used in the multiple versions of setObject(...) and getObject(...) methods. They deliver results very similar to their counterparts, Date, Time and Timestamp respectively. The types OffsetDateTime and OffsetTime are partially supported via conversion to *CHAR types as MySQL doesn’t provide support for temporal data containing time zone information and, thus, doesn’t support the new TIME_WITH_TIMEZONE and TIMESTAMP_WITH_TIMEZONE JDBC types as well.

As a consequence to this upgrade, Connector/J 5.1.37 and future versions require Java 8 for its building process. We maintained, however, full compatibility with the already supported Java versions – Java 5 and above, Thus, this is a seamless replacement for the previous drivers versions you may be using in your projects.

New Connection Properties

sendFractionalSeconds. This property controls whether fractional seconds in timestamps are to be truncated on the client side or to be sent to the server side where they may be subject to rounding. It takes a boolean value:

sendFractionalSeconds=true|false

Rounding fractional seconds may lead to undesired situations, especially when this results in apparently “big” temporal leaps, such as advancing a timestamp value to the next minute, day or even year. Many times this is not the required behavior for applications and setting this property to false safely cancels it.

Mind that this option applies only to prepared statements, callable statements and updatable result sets.

enableEscapeProcessing. This property, introduced as part of the support for JDBC 4.2, sets the default escape processing behavior for Statement objects. It takes a boolean value:

enableEscapeProcessing=true|false

The method Statement.setEscapeProcessing() allows to set the escape processing behavior for individual statements. This method’s documentation refers that the connection property escapeProcessing can be used to set the default behavior, however, in Connector/J, this property is actually named enableEscapeProcessing.

Note that the default escape processing behavior in prepared statements is set by the long time available property processEscapeCodesForPrepStmts.

Changes in the Building Process

With JDBC 4.2 support comes a dependency on the Java 8 compiler and with it some changes in the building from source procedure. The documentation contains all the details you need to know but, the fast shortcut is that the previous ant property com.mysql.jdbc.jdk6 was upgraded to com.mysql.jdbc.jdk8 and holds the obvious reference to the JDK 8 path.

The optional property com.mysql.jdbc.java6.rtjar was added as well and is used to obtain the most accurate byte codes for every single JDBC implementation contained in this driver. You are not required to use it unless you are building for production, in which case we recommend you to set it too.

Bug Fixes

Several bug fixes were introduced aiming to improve your Connector/J experience.

We were able to fix a few things in the meta data structures, a time zone related adjustment, a couple of null point exceptions and corrected the right type of exception, all observed in very specific situations. We improved the authentication procedure, making it more robust. And, finally, we tweaked the driver to be fully compliant with latest MySQL server releases.

Thanks!

This release contains some contributions from end users. Special thanks to Jie Han and KwonNam for their valuable contributions.

Thank you all for your support as well. Enjoy this new Connector/J and keep in touch!

On behalf of the MySQL Connector/J Team.