Functionality Added or Changed
Multiple result sets were not supported when using streaming
mode to return data. Both normal statements and the result sets
from stored procedures now return multiple results sets, with
the exception of result sets using registered
verifyServerCertificate property. If
set to "false" the driver will not verify the server's
useSSL is set to "true"
When using this feature, the keystore parameters should be
specified by the
properties, rather than system properties, as the JSSE doesn't
it straightforward to have a nonverifying trust store and the
"default" key store.
The profiler event handling has been made extensible using the
profilerEventHandler connection property.
XAConnections and datasources have been updated to the JDBC-4.0 standard.
Compiling in Eclipse could produce a compilation warning for
line 814 in the
(Bug #11746221, Bug #24595)
Prepared statements from pooled connections caused a
closed() under JDBC-4.0.
useServerPrepStmts=true and slow query
logging is enabled, the connector throws a
NullPointerException when it encounters a
The JDBC driver uses a different method for evaluating column
when looking for a column in
causes Hibernate to fail in queries where the two methods yield
different results, for example in queries that use alias names:
SELECT column AS aliasName from table
COLUMN_SIZE value for
When trying to read
Time values like
ResultSet.getTime(int) an exception is
When using the keyword “loadbalance” in the connection string and trying to perform load balancing between two databases, the driver appears to hang. (Bug #35660)
JDBC data type getter method was changed to accept only column name, whereas previously it accepted column label. (Bug #35610)
In calling a stored function returning a
bigint, an exception is encountered
java.sql.SQLException: java.lang.NumberFormatException: For input string:
JDBC connection URL parameters is ignored when using
MysqlConnectionPoolDataSource does not
ReplicationConnection. Notice that we
ReplicationConnection, however, only
accessors from ConnectionProperties are implemented (not the
mutators), and they return values from the currently active
connection. All other methods from
com.mysql.jdbc.Connection are implemented,
and operate on the currently active connection, with the
isValid() on an active
connection, if the timeout is nonzero then the
Connection is invalidated even if the
Connection is valid.
When retrieving the column type name of a geometry field, the
driver would return
UNKNOWN instead of
The internal class
ResultSetInternalMethods referenced the
ResultSet.getTimestamp() would throw a
NullPointerException instead of a
SQLException when called on an empty
ResultSet.getTimestamp() returns incorrect
values for month/day of
TIMESTAMPs when using server-side
prepared statements (not enabled by default).
RowDataStatic doesn't always set the
ResultSetRow, which can lead
to failures when unpacking
TIMESTAMP types when using
absolute, relative, and previous result set navigation methods.
It was not possible to truncate a
Blog.truncate() when using 0 as an argument.
Statements with batched values do not return correct values for
rewriteBatchedStatements is set to
true, and the statement has an
DUPLICATE KEY UPDATE clause.
NullPointerException could be raised when
using client-side prepared statements and enabled the prepared
statement cache using the
When using a cursor fetch for a statement, the internal prepared statement could cause a memory leak until the connection was closed. The internal prepared statement is now deleted when the corresponding result set is closed. (Bug #34518)
Using server side cursors and cursor fetch, the table metadata information would return the data type name instead of the column name. (Bug #33594)
Load balancing connection using best response time would incorrectly "stick" to hosts that were down when the connection was first created.
We solve this problem with a black list that is used during the
picking of new hosts. If the black list ends up including all
configured hosts, the driver will retry for a configurable
number of times (the
configuration property, with a default of 120 times), sleeping
250ms between attempts to pick a new connection.
We've also went ahead and made the balancing strategy
extensible. To create a new strategy, implement the interface
also includes our standard "extension" interface), and tell the
driver to use it by passing in the class name using the
loadBalanceStrategy configuration property.
Retrieving the server version information for an active connection could return invalid information if the default character encoding on the host was not ASCII compatible. (Bug #31192)
ResultSet returned by
Statement.getGeneratedKeys() is not closed
automatically when statement that created it is closed.
return the correct column names if the connection character
isn't UTF-8. A bug in MySQL server compounded the issue, but was
fixed within the MySQL 5.0 release cycle. The fix includes
changes to all the sections of the code that access the server
CallableStatement.setNull() on a
stored function would throw an
ArrayIndexOutOfBounds exception when setting
the last parameter to null.
When using a connection from
Connection.prepareStatement() methods would
return null instead of the prepared statement.
properly handle connections created using
for result sets returned from
Statement.getGeneratedKeys() - it was
returning null instead of "GENERATED_KEY" as in 5.0.x.
During a Daylight Savings Time (DST) switchover, there was no way to store two timestamp/datetime values , as the hours end up being the same when sent as the literal that MySQL requires.
Note that to get this scenario to work with MySQL (since it
doesn't support per-value timezones), you need to configure your
server (or session) to be in UTC, and tell the driver not to use
the legacy date/time code by setting
useLegacyDatetimeCode to "false". This will
cause the driver to always convert to/from the server and client
This bug fix also fixes Bug #15604, by adding entirely new
date/time handling code that can be switched on by
useLegacyDatetimeCode being set to "false" as a
JDBC configuration property. For Connector/J 5.1.x, the default
is "true", in trunk and beyond it will be "false" (that is, the
old date/time handling code will be deprecated)
(Bug #32577, Bug #15604)
When unpacking rows directly, we don't hand off error message packets to the internal method which decodes them correctly, so no exception is raised, and the driver than hangs trying to read rows that aren't there. This tends to happen when calling stored procedures, as normal SELECTs won't have an error in this spot in the protocol unless an I/O error occurs. (Bug #32246)
Further fixes have been made to this bug in the event that a node is nonresponsive. Connector/J will now try a different random node instead of waiting for the node to recover before continuing. (Bug #31053)