This is the first public alpha release of the current Connector/J 5.1 development branch, providing an insight to upcoming features. Although some of these are still under development, this release includes the following new features and changes (in comparison to the current Connector/J 5.0 production release):
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 you must add the following configuration property to your connector string:
useServerPrepStmts=true
The default value of this property is false
(that is, Connector/J does not use server-side prepared
statements).
The disabling of server-side prepared statements does not
affect the operation of the connector. However, if you use the
useTimezone=true
connection option and use
client-side prepared statements (instead of server-side
prepared statements) you should also set
useSSPSCompatibleTimezoneShift=true
.
Functionality added or changed:
Refactored
CommunicationsException
into a JDBC-3.0 version, and a JDBC-4.0 version (which extendsSQLRecoverableException
, now that it exists).NoteThis change means that if you were catching
com.mysql.jdbc.CommunicationsException
in your applications instead of looking at the SQLState class of08
, and are moving to Java 6 (or newer), you need to change your imports to that exception to becom.mysql.jdbc.exceptions.jdbc4.CommunicationsException
, as the old class will not be instantiated for communications link-related errors under Java 6.Added support for JDBC-4.0 categorized
SQLExceptions
.Added support for JDBC-4.0's
NCLOB
, andNCHAR
/NVARCHAR
types.com.mysql.jdbc.java6.javac
: Full path to your Java-6 javac executableAdded support for JDBC-4.0's SQLXML interfaces.
Re-worked Ant buildfile to build JDBC-4.0 classes separately, as well as support building under Eclipse (since Eclipse can't mix/match JDKs).
To build, you must set
JAVA_HOME
to J2SDK-1.4.2 or Java-5, and set the following properties on your Ant command line:com.mysql.jdbc.java6.javac
: Full path to your Java-6 javac executablecom.mysql.jdbc.java6.rtjar
: Full path to your Java-6rt.jar
file
New feature—driver will automatically adjust session variable
net_write_timeout
when it determines it has been asked for a "streaming" result, and resets it to the previous value when the result set has been consumed. (configuration property is namednetTimeoutForStreamingResults
value and has a unit of seconds, the value0
means the driver will not try and adjust this value).Added support for JDBC-4.0's client information. The backend storage of information provided using
Connection.setClientInfo()
and retrieved byConnection.getClientInfo()
is pluggable by any class that implements thecom.mysql.jdbc.JDBC4ClientInfoProvider
interface and has a no-args constructor.The implementation used by the driver is configured using the
clientInfoProvider
configuration property (with a default of value ofcom.mysql.jdbc.JDBC4CommentClientInfoProvider
, an implementation which lists the client information as a comment prepended to every query sent to the server).This functionality is only available when using Java-6 or newer.
com.mysql.jdbc.java6.rtjar
: Full path to your Java-6rt.jar
fileAdded support for JDBC-4.0's
Wrapper
interface.