Appending connection string to datasource

I’m trying to create a datasource programmatically and append to the connection string. I need to add the following MSSQL connection string: “DateTimeInputParameterType=dateTime” to make preserve sending datetime params as “datetime” and not “datetime2” values.

Looking at the documentation, it would appear I should be able to pass the following to the updateDatasource() method of the Administrator.cfc:

“custom”: “DateTimeInputParameterType=dateTime”

However, the actual component (Lucee/Administrator.cfc at 7d73d7357de7a0b0e91d7b7df27b37aa6171d67c · lucee/Lucee · GitHub) does not seem to support this.

Or should it be:


custom needs to be a struct, but the var custom=structNew(); should go, rather updateDatasource should accept custom as an argument

custom = { DateTimeInputParameterType":"dateTime" }


should work tho

Thanks!. That’s what I was really thinking was probably correct.

What’s the customUseLegacyDatetimeCode do in Lucee 6?

I have a feeling that might be doing what I’m wanting, but I’m not sure based on the comment hint, which just says:

@customUseLegacyDatetimeCode Use code for DATE/TIME/DATETIME/TIMESTAMP handling in result sets and statements

it’s a mysql jdbc feature/quirk

I’ve filed an enhancement

FYI, I added a PR on that ticket

1 Like