Connector/J 3 Gotcha

As is pretty common knowledge, CFMX 6, CFMX 7, and BD all ship with
JDBC drivers for MySQL 3.x.  There have been several posts (here's
one from Steven Erat)
about installing MySQL Connector/J 3.x, which is the driver for MySQL
4.x.  In particular, it supports the new authentication scheme
that was introduced in the 4 series.

I've done this on several
servers with great success, but I ran into a little problem a couple
days ago, and thought I'd share.  MySQL stores 0000-00-00 00:00:00
as the default value for NOT NULL DATETIME columns.  With the
default MySQL drivers, that gets converted to November 30th 0002, but
with the updated drivers, it throws a date format exception.  I
can't say for sure if it happens all the time, but at least sometimes.

a properly designed app and schema, this shouldn't be a problem (since
those values should be NULL, not the "zero" date), but if you've got
garbage lurking, it's definitely worth a careful look if you're
considering the updated drivers.

Comments are closed.