I created a CFConfig.json file by using the "cfconfig export" cli command after setting up the datasource the way I need it. In particular it was important to set the zeroDateTimeBehaviour to convert to NULL for backwards compatibility. The export added this value to the connection string.
After trying to use this new cfconfig.json file however, I get the following error:
The connection property 'zeroDateTimeBehavior' only accepts values of the form: 'exception', 'round' or 'convertToNull'. The value 'CONVERT_TO_NULL' is not in this set.
Thanks for the ticket. I’m not familiar with the JDBC option here. Can you answer some question for me?
Are you on the latest version of CFConfig
Is your CF engine Adobe or Lucee and what version?
What type of datasoruce are you creating? (MySQL, Oracle, MSSQL, etc)
Can you provide steps for creating the JSON export that doesn’t work.
Thanks for the follow up. I’ve discovered it is specific to the older MySQL driver class.
I’m running Lucee inside a Commandbox docker image. I installed CFCONFIG in the docker image immediately prior to running the export, so yes, it should be the latest version.
Datasource is MySQL
Steps taken to get to the problem.
Create a MySQL datasource in Lucee admin
For the option “Zero DateTime behavior” set it to CONVERT_TO_NULL
cfconfig export .cfconfig.json
Set the mysql connector class in the cfconfig to com.mysql.jdbc.Driver
Try running a query with this datasource and you will get the error.
If you set the Mysql connector class to com.mysql.cj.jdbc.Driver instead, it works. Considering this, I’m not sure whether you can be bothered making a fix for what is a deprecated class. It seems the new class does in fact use the CONVERT_TO_NULL value instead of convertToNull