Wednesday, October 5, 2011

Coldfusion 9 not sending connection string to MySQL 4/5 datasource. (zeroDateTimeBehavior)

I was unable to get Coldfusion 9 server to take the usual fix for the following:

java.sql.SQLException: Cannot convert value '0000-00-00 00:00:00' from column 20
to TIMESTAMP.

which is to put:

zeroDateTimeBehavior=convertToNull

in the data source connection options. This method fixed the problem in all previous versions of ColdFusion.

My workaround was to add a 'Custom' data source and add all the normal JDBC variables and add the zertoDateTimeBehavior option to the actual URL instead of letting ColdFusion 9 try to do it.