Version 9.1.0 is a new GA release of MySQL Connector/J. MySQL Connector/J 9.1.0 supersedes 9.0 and is recommended for use on production systems. This release can be used against MySQL Server version 8.0 and later. It supports the Java Database Connectivity (JDBC) 4.2 API, and implements the X DevAPI.
When connecting to a server using SSL, the truststore password is now made optional, with a null truststore password taken to mean that there is no need to check the truststore's keyed digest. Thanks to Jesper Blomquist for contributing to the patch. (Bug #114705, Bug #36539680)
isTimestamp()
no longer creates a regular expressionPattern
instance when it is called, which leads to better code performance. (Bug #114410, Bug #36434816)Connector/J now supports the OpenID Connect authentication protocol, which is supported by MySQL Enterprise 9.1.0 and later. See Connecting Using OpenID Connect Authentication for details. (WL #16490)
The
PrepareCall()
method failed when the schema name was used in the connection URL and when any call parameter had a question mark in it. (Bug #36936407)When using
PreparedStatements
, negativeDATE
values were inserted as some positive values instead of being rejected. (Bug #116114, Bug #37067812)Repeated calls of the same procedure or function would fail when using
callableStatements
due to the failure of Connector/J to cache and map the correct information for the procedure or function parameters. (Bug #115265, Bug #36843227)Setting
closeOnCompletion()
on aPreparedStatement
made statement reuse fail in some cases, as the closing and caching of the statement were not performed correctly. (Bug #113509, Bug #36154975)After using
executeBatch()
to insert rows into a table and adding more rows withexecuteUpdate()
,getGeneratedKeys()
returned the wrong keys for the inserted rows. (Bug #112790, Bug #35936477)When retrieving a
ResultSet
column usinggetString()
for a field with theZEROFILL
flag on, the result was not zero padded. (Bug #110586, Bug #35254470)When the connection properties
rewriteBatchedStatements
,useServerPrepStmts
andcachePrepStmts
were all set totrue
, inserting duplicated keys in batches caused the wrong kind of exception to be thrown by Connector/J. (Bug #109418, Bug #36043556)When a
QueryTimer
was set, if a session failed, Connector/J returned aNullPointerException
. With this fix, aSQL Exception
is returned instead. Thanks to Anthony Milbourne for contributing to this patch. (Bug #108415, Bug #34579258)When adding a long SQL string to a batched
Statement
, if the string's length was greater than the value ofmaxAllowedPacket
, anArrayIndexOutOfBoundsException
was thrown. With this fix, checks are now in place so that aSQLException
is thrown instead in the situation. (Bug #101054, Bug #32544786)When
rewriteBatchedStatements
was set totrue
, Connector/J failed to detect some cases in which server-sidePreparedStatements
could not be used, resulting in errors for the statement preparations. With this fix, Connector/J detected the issues and uses client-sidePreparedStatements
instead in those situations. (Bug #96623, Bug #30221117)PreparedStatments
executed with the connection propertyincludeThreadNamesAsStatementComment
set to true did not include the name of the current thread in a comment as expected. This fix corrected the omission. Thanks to Yyjun Yyjun for contributing to this patch. (Bug #84117, Bug #25247468)