Tuesday, July 24, 2007

MySQL Releases New Driver With Built In ColdFusion Specific Optimizations

MySQL has released a beta of a new version of their Java driver.

MySQL Connector/J 5.1.2 beta, a new version of the Type-IV pure-Java JDBC driver for MySQL
has been released.

Version 5.1.2 is suitable for use with any MySQL version including MySQL-4.1, MySQL-5.0,
MySQL-5.1 beta or the MySQL-6.0 Falcon alpha release.

It is now available in source and binary form from the Connector/J download pages at


and mirror sites (note that not all mirror sites may be up to date at this point of time -
if you can't find this version on some mirror, please try again later or choose another
download site.)

As always, we recommend that you check the change log


and "Upgrading" sections


in the manual before upgrading as well as the "CHANGES" file in the download archive to be
aware of changes in behavior that might affect your application.

We welcome and appreciate your feedback, bug reports, bug fixes, patches etc.:


This is the first beta release of our implementation of the new JDBC-4.0 API, along with
some new performance features.

This beta release, as any other pre-production release, should not be installed on
production level systems or systems with critical data. It is good practice to back up
your data before installing any new version of software. Although MySQL has worked very
hard to ensure a high level of quality, protect your data by making a backup as you would
for any other software pre-production release.

MySQL Connector/J 5.1.2 includes the following new feature compared to 5.1.1:

  * Setting the configuration property "rewriteBatchedStatements" to "true" will now cause
the driver to rewrite batched prepared statements with more than 3 parameter sets in a
batch into     multi-statements (separated by ";") if they are not plain (i.e. without

The following features are new, compared to the 5.0 series of Connector/J:

  * JDBC-4.0 ease-of-development features including auto-registration with the
DriverManager via the service provider mechanism, standardized Connection validity checks
and categorized SQLExceptions based on recoverability/retry-ability and class of the
underlying error.

  * JDBC-4.0 standardized unwrapping to interfaces that include vendor extensions

  * Support for JDBC-4.0 XML processing via JAXP interfaces to DOM, SAX and StAX

  * JDBC-4.0 support for setting per-connection client information (which can be viewed in
the comments section of a query via "SHOW PROCESSLIST" on a MySQL server, or can be
extended to support custom persistence of the information via a public interface)

  * Support for JDBC-4.0 NCHAR, NVARCHAR and NCLOB types

  * The driver will automatically adjust the server session variable "net_write_timeout"
when it determines its been asked for a "streaming" result, and resets it to the previous
value when the result set has been consumed. (The configuration property is named
"netTimeoutForStreamingResults", with a unit of seconds, the value '0' means the driver
will not try and adjust this value).

  * Added experimental support for statement "interceptors" via the  
com.mysql.jdbc.StatementInterceptor interface, examples are in
com/mysql/jdbc/interceptors.  Implement this interface to be placed "in between" query
execution, so that it can be influenced (currently experimental).

  * The data (and how it's stored) for ResultSet rows are now behind an interface which
allows us (in some cases) to allocate less memory per row, in that for "streaming" result
sets, we re-use the packet used to read rows, since only one row at a time is ever active.

  * The driver now picks appropriate internal row representation (whole row in one buffer,
or individual byte[]s for each column value) depending on heuristics, including whether or
not the row has BLOB or TEXT types and the overall row-size. The threshold for row size
that will cause the driver to use a buffer rather than individual byte[]s is configured
by the configuration property "largeRowSizeThreshold", which has a default value of 2KB.

  * Setting "rewriteBatchedStatements" to "true" now causes CallableStatements with
batched arguments to be re-written in the form "CALL (...); CALL (...); ..." to send the
batch in as few client-server round trips as possible.

This release also includes the following cahnges that are also present in Connector/J
5.0.7 (not yet released):

  * Setting the configuration parameter "useCursorFetch" to "true" for MySQL-5.0+ enables
the use of cursors that allow Connector/J to save memory by fetching result set rows in
chunks (where the chunk size is set by calling setFetchSize() on a Statement or
ResultSet) by using fully-materialized cursors on the server.
      The driver will will now automatically set "useServerPrepStmts" to
      "true" when "useCursorFetch" has been set to "true", since the feature
      requires server-side prepared statements in order to function.

  * Fixed BUG#28469 - PreparedStatement.getMetaData() for statements containing leading
one-line comments is not returned correctly.

    As part of this fix, we also overhauled detection of DML for executeQuery() and
SELECTs for executeUpdate() in plain and prepared statements to be aware of the same
types of comments.

  * Added configuration property "useNanosForElapsedTime" - for profiling/debugging
functionality that measures elapsed time, should the driver try to use nanoseconds
resolution if available    (requires JDK >= 1.5)?
  * Added configuration property "slowQueryThresholdNanos" - if "useNanosForElapsedTime"
is set to "true", and this property is set to a non-zero value the driver will use this
threshold     (in nanosecond units) to determine if a query was slow, instead of using
millisecond units.
    Note, that if "useNanosForElapsedTime" is set to "true", and this property is set to
"0" (or left default), then elapsed times will  still be measured in nanoseconds (if
possible), but the slow query threshold will be converted from milliseconds to
nanoseconds, and thus have an upper bound of approximately 2000 millesconds (as that
threshold is represented as an integer, not a long).
  * Added configuration properties to allow tuning of TCP/IP socket parameters:
  "tcpNoDelay" - Should the driver set SO_TCP_NODELAY (disabling the
                 Nagle Algorithm, default "true")?

"tcpKeepAlive" - Should the driver set SO_KEEPALIVE (default "true")?

"tcpRcvBuf" - Should the driver set SO_RCV_BUF to the given value?
              The default value of '0', means use the platform default
              value for this property.

"tcpSndBuf" - Should the driver set SO_SND_BUF to the given value?
              The default value of '0', means use the platform default
              value for this property.

"tcpTrafficClass" - Should the driver set traffic class or
                    type-of-service fields? See the documentation
                    for java.net.Socket.setTrafficClass() for more

  * Give more information in EOFExceptions thrown out of MysqlIO (how many bytes the
driver expected to read, how many it actually read, say that communications with the
server were unexpectedly lost).
  * Setting "useDynamicCharsetInfo" to "false" now causes driver to use static lookups for
collations as well (makes ResultSetMetadata.isCaseSensitive() much more efficient, which
leads to performance increase for ColdFusion, which calls this method for every column on
every table it sees, it appears).
  * Driver detects when it is running in a ColdFusion MX server (tested with version 7),
and uses the configuration bundle "coldFusion", which sets useDynamicCharsetInfo to
"false" (see previous entry), and sets useLocalSessionState and autoReconnect to "true".

  * Fixed BUG#28851 - parser in client-side prepared statements silently consumes
character following '/' if it's not a multi-line comment.
  * Fixed BUG#28596 - parser in client-side prepared statements runs to end of statement,
rather than end-of-line for '#' comments. Also added support for '--' single-line



- --
Mark Matthews, Architect (Client Connectivity)
MySQL, Inc. Chicago, USA - www.mysql.com
Version: GnuPG v1.4.6 (MingW32)



Anonymous said...

Excellent web site you haνe gоt hеre.

. It's difficult to find quality writing like yours nowadays. I really appreciate people like you! Take care!!

Feel free to surf to my website; taxi irving tx

Anonymous said...

A sad working day for TED the only way forward in science would be the
continuous challenge of new ideas, pointing out anomalies in any current theory or paradigm.
Just imagine a world without having those inquiries
and new ideas we may possibly still believe that the
earth would be the center in the universe and/or flat.
So actually absolutely nothing new below the sun Galileo, Copernicus the two knew the incredibly strong defense system' the current powers that be' they ended
up in prison so as to silence them. It is strange even though that TED Talks has succumbed to
this effective defense system' in a way Sheldrake is silenced too. I believed this was specifically what TED Talks was about.....giving these innovative, creative and challenging ideas a platform, a place for new and unusual thoughts to be voiced and heard. So that the debate may go on, to support us all on this planet uncover our way forward!!

My web blog; weight loss before and after teenage girls

Anonymous said...

I just joined an interracial relationship web site that i thought was just for white females and black males but all
I at any time see are white males in search of black females
and vice versa.

Feel free to visit my weblog - female mind mastery by kirsten price

Anonymous said...

send out me fat attaining guidelines remember to and thank you

Also visit my blog post ... gain muscle Mass diet

Anonymous said...

I will give this a attempt but am detoxing my liver at the moment

Feel free to visit my web site: six pack shortcuts the forgotten files insane home fat loss

Anonymous said...

I am really impressed with your writing skills as well
as with the layout on your weblog. Is this a paid theme or did you
customize it yourself? Anyway keep up the excellent quality writing, it's rare to see a great blog like this one today.

My website: how to pick up girls at a club

Anonymous said...

I ordered a lovely ring from Dangle Dangle and it was on back buy, but conversation to let me to understand the standing of
my order was updated regularly and anytime I
obsessed about this. I now have my ring along with the
photographs didn't get it done justice, it truly is gorgeous. Dangle Dangle is currently my visit jewelry shop. Many thanks once more!!

Feel free to surf to my web site: weight loss supplements with ephedra

Anonymous said...

Good information. Lucky me I found your site by accident (stumbleupon).
I've saved as a favorite for later!

Also visit my web page office furniture chairs ergonomic

Anonymous said...

I have been undertaking quite strict Paleo given
that September and it is worked great. Every one one particular of my auto-immune symptoms is gone.
But everywhere I turn these times, even in Paleo circles, I locate folks
weighing and measuring and tracking their nutrition, macros,
etc. and making even far more progress. Now that
you mention it though, it really is entirely achievable that all these other individuals who are adding
that extra element to their diet plan could be doing so for specific reasons.
I enjoy you pointing that out. I am producing enough progress without that proper now.

my page ... precision nutrition lean eating coaching program

Anonymous said...

Will you guys utilize Cando Cameron from WKS? My children ALWAYS loved watching
him. I was usually impressed by Cando as well.

my web-site; celebrity workout routine for women