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 when connecting.
We've added a new configuration option
treatUtilDateAsTimestamp, which is
falseby 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 JDBC-post-4.0.
Usage Advisor will now issue warnings for result sets with large numbers of rows. You can configure the trigger value by using the
resultSetSizeThresholdparameter, which has a default value of 100.
rewriteBatchedStatementsfeature can now be used with server-side prepared statements.
Fixed logging of XA commands sent to server, it is now configurable using
logXaCommandsproperty (defaults to
Improved speed of
datetimeparsing for ResultSets that come from plain or nonserver-side prepared statements. You can enable old implementation with
useFastDateParsing=falseas a configuration parameter.
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
false(that is, Connector/J does not use server-side prepared statements).
socketFactorywasn't 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). (Bug #26326)
A query execution which timed out did not always throw a
MySQLTimeoutException. (Bug #25836)
java.util.Dateobject in a
BLOBcolumn would not be serialized correctly during
setObject. (Bug #25787)
Timer instance used for
Statement.setQueryTimeout()created per-connection, rather than per-VM, causing memory leak. (Bug #25514)
EscapeProcessorgets confused by multiple backslashes. We now push the responsibility of syntax errors back on to the server for most escape sequences. (Bug #25399)
CallableStatementsget doubly escaped. (Bug #25379)
When using the
rewriteBatchedStatementsconnection option with
PreparedState.executeBatch()an internal memory leak would occur. (Bug #25073)
Fixed issue where field-level for metadata from
INFORMATION_SCHEMAdidn't have references to current connections, sometimes leading to Null Pointer Exceptions (NPEs) when introspecting them using
ResultSetMetaData. (Bug #25073)
StringUtils.indexOfIgnoreCaseRespectQuotes()isn't case-insensitive on the first character of the target. This bug also affected
rewriteBatchedStatementsfunctionality when prepared statements did not use uppercase for the
VALUESclause. (Bug #25047)
Client-side prepared statement parser gets confused by in-line comments
/*...*/and therefore cannot rewrite batch statements or reliably detect the type of statements when they are used. (Bug #25025)
Results sets from
UPDATEstatements that are part of multi-statement queries would cause an
SQLExceptionerror, "Result is from UPDATE". (Bug #25009)
US-ASCIIas the character set in a connection to a MySQL 4.1 or newer server does not map correctly. (Bug #24840)
DatabaseMetaData.getSQLKeywords()does 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 versions. (Bug #24794)
Statement.cancel()could result in a Null Pointer Exception (NPE). (Bug #24721)
SHOWand other commands. (Bug #24360)
Calendars and timezones are now lazily instantiated when required. (Bug #24351)
DATETIMEcolumns would result in time shifts when
useServerPrepStmtswas true. This occurred due to different behavior when using client-side compared to server-side prepared statements and the
useJDBCCompliantTimezoneShiftoption. 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 statements. (Bug #24344)
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
ciasvariants of existing character sets), and inability to override the detected server character set. (Bug #23645)
INFORMATION_SCHEMA. (Bug #23304)
DatabaseMetaData.getSchemas()doesn't return a
TABLE_CATALOGcolumn. (Bug #23303)
When using a JDBC connection URL that is malformed, the
NonRegisteringDriver.getPropertyInfomethod will throw a Null Pointer Exception (NPE). (Bug #22628)
Some exceptions thrown out of
StandardSocketFactorywere needlessly wrapped, obscuring their true cause, especially when using socket timeouts. (Bug #21480)
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)
NullPointerExceptionwhen prepared SQL has a syntax error. Added
generateSimpleParameterMetadataconfiguration property, which when set to
truewill generate metadata reflecting
VARCHARfor every parameter (the default is
false, which will cause an exception to be thrown if no parameter metadata for the statement is actually available). (Bug #21267)
The manifest file in the Connector/J JAR package was incorrect. (Bug #15641, Bug #11745464)
Fixed an issue where
XADataSourcescouldn't be bound into JNDI, as the
DataSourceFactorydidn't know how to create instances of them.
When extracting foreign key information from
SHOW CREATE TABLEin
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
BEGINin 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.
localSocketAddressproperty into account when creating instances of
CommunicationsExceptionwhen the underlying exception is a
java.net.BindException, so that a friendlier error message is given with a little internal diagnostics.
Throw exceptions encountered during timeout to thread calling
Statement.execute*(), rather than
Fixed cases where
ServerPreparedStatementsweren't using cached metadata when
When using cached metadata, skip field-level metadata packets coming from the server, rather than reading them and discarding them without creating
java.util.TreeMapto map column names to ordinal indexes for
ResultSet.findColumn()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
HashMapwith 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 implemented.
Fixed some Null Pointer Exceptions (NPEs) when cached metadata was used with