Functionality Added or Changed
Added configuration property
localSocketAddress, which is the host name or
IP address given to explicitly configure the interface that the
driver will bind the client side of the TCP/IP connection to
We've added a new configuration option
treatUtilDateAsTimestamp, which is
false by default, as (1) We already had
specific behavior to treat java.util.Date as a
java.sql.Timestamp because it is useful to many folks, and (2)
that behavior will very likely be required for drivers
Usage Advisor will now issue warnings for result sets with large
numbers of rows. You can configure the trigger value by using
resultSetSizeThreshold parameter, which
has a default value of 100.
rewriteBatchedStatements feature can now
be used with server-side prepared statements.
Fixed logging of XA commands sent to server, it is now
Improved speed of
datetime parsing for
ResultSets that come from plain or nonserver-side prepared
statements. You can enable old implementation with
useFastDateParsing=false as a configuration
Usage Advisor now detects empty results sets and does not report on columns not referenced in those empty sets.
Important change: Due to a number of issues with the use of server-side prepared statements, Connector/J 5.0.5 has disabled their use by default. The disabling of server-side prepared statements does not affect the operation of the connector in any way.
To enable server-side prepared statements, add the following configuration property to your connector string:
The default value of this property is
(that is, Connector/J does not use server-side prepared
exposed using correctly named mutator/accessor, causing data
source implementations that use JavaBean naming conventions to
set properties to fail to set the property (and in the case of
SJAS, fail silently when trying to set this parameter).
A query execution which timed out did not always throw a
java.util.Date object in a
BLOB column would not be
serialized correctly during
Timer instance used for
per-connection, rather than per-VM, causing memory leak.
EscapeProcessor gets confused by multiple
backslashes. We now push the responsibility of syntax errors
back on to the server for most escape sequences.
INOUT parameters in
CallableStatements get doubly escaped.
When using the
connection option with
PreparedState.executeBatch() an internal
memory leak would occur.
Fixed issue where field-level for metadata from
DatabaseMetaData when using
INFORMATION_SCHEMA didn't have references to
current connections, sometimes leading to Null Pointer
Exceptions (NPEs) when introspecting them using
isn't case-insensitive on the first character of the target.
This bug also affected
rewriteBatchedStatements functionality when
prepared statements did not use uppercase for the
Client-side prepared statement parser gets confused by in-line
/*...*/ and therefore cannot rewrite
batch statements or reliably detect the type of statements when
they are used.
Results sets from
statements that are part of multi-statement queries would cause
SQLException error, "Result is from
US-ASCII as the character set in a
connection to a MySQL 4.1 or newer server does not map
not return a all of the of the reserved keywords for the current
MySQL version. Current implementation returns the list of
reserved words for MySQL 5.1, and does not distinguish between
Statement.cancel() could result in a
Null Pointer Exception (NPE).
setFetchSize() breaks prepared
SHOW and other commands.
Calendars and timezones are now lazily instantiated when required. (Bug #24351)
DATETIME columns would
result in time shifts when
was true. This occurred due to different behavior when using
client-side compared to server-side prepared statements and the
useJDBCCompliantTimezoneShift option. This is
now fixed if moving from server-side prepared statements to
client-side prepared statements by setting
true, as the driver can't tell if this is a
new deployment that never used server-side prepared statements,
or if it is an existing deployment that is switching to
client-side prepared statements from server-side prepared
Connector/J now returns a better error message when server doesn't return enough information to determine stored procedure/function parameter types. (Bug #24065)
A connection error would occur when connecting to a MySQL server
with certain character sets. Some collations/character sets
reported as "unknown" (specifically
variants of existing character sets), and inability to override
the detected server character set.
DatabaseMetaData.getSchemas() doesn't return
When using a JDBC connection URL that is malformed, the
will throw a Null Pointer Exception (NPE).
Some exceptions thrown out of
StandardSocketFactory were needlessly
wrapped, obscuring their true cause, especially when using
When using a server-side prepared statement the driver would send timestamps to the server using nanoseconds instead of milliseconds. (Bug #21438)
When using server-side prepared statements and timestamp columns, value would be incorrectly populated (with nanoseconds, not microseconds). (Bug #21438)
NullPointerException when prepared SQL has a
syntax error. Added
property, which when set to
generate metadata reflecting
VARCHAR for every parameter (the
false, which will cause an
exception to be thrown if no parameter metadata for the
statement is actually available).
The manifest file in the Connector/J JAR package was incorrect. (Bug #15641, Bug #11745464)
Fixed an issue where
be bound into JNDI, as the
didn't know how to create instances of them.
When extracting foreign key information from
SHOW CREATE TABLE in
DatabaseMetaData, ignore exceptions relating
to tables being missing (which could happen for cross-reference
or imported-key requests, as the list of tables is generated
first, then iterated).
Avoid static synchronized code in JVM class libraries for dealing with default timezones.
Reverted back to internal character conversion routines for single-byte character sets, as the ones internal to the JVM are using much more CPU time than our internal implementation.
Re-worked stored procedure parameter parser to be more robust.
Driver no longer requires
BEGIN in stored
procedure definition, but does have requirement that if a stored
function begins with a label directly after the "returns"
clause, that the label is not a quoted identifier.
Performance enhancement of initial character set configuration, driver will only send commands required to configure connection character set session variables if the current values on the server do not match what is required.
localSocketAddress property into account
when creating instances of
CommunicationsException when the underlying
exception is a
that a friendlier error message is given with a little internal
Throw exceptions encountered during timeout to thread calling
Statement.execute*(), rather than
Fixed cases where
weren't using cached metadata when
cacheResultSetMetadata=true was used.
When using cached metadata, skip field-level metadata packets
coming from the server, rather than reading them and discarding
them without creating
java.util.TreeMap to map column names
to ordinal indexes for
instead of a HashMap. This enables us to have case-insensitive
lookups (required by the JDBC specification) without resorting
to the many transient object instances needed to support this
requirement with a normal
HashMap with either
case-adjusted keys, or case-insensitive keys. (In the worst case
scenario for lookups of a 1000 column result set, TreeMaps are
about half as fast wall-clock time as a HashMap, however in
normal applications their use gives many orders of magnitude
reduction in transient object instance creation which pays off
later for CPU usage in garbage collection).
Changed cached result set metadata (when using
cacheResultSetMetadata=true) to be cached
per-connection rather than per-statement as previously
Fixed some Null Pointer Exceptions (NPEs) when cached metadata
was used with