Upgrade MSSQL driver to v8.4.1 JRE 11

I’ve been having trouble finding a JDBC driver that will work properly under Lucee 5.3.6.61 and Tomcat 9.0.37 under Java 11. I’ve tried the JTDS and the SQL Server v7.2.2.jre8, but each one of them is causing me different issues:

  1. JTDS — I can’t get XML datatypes to work. Any time a query contains a column with an XML datatype, it throws a The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 1 (""): Data type 0xF1 is unknown. error.
  2. v7.2.2.jre8 — This works with XML datatypes, but any query that generates multiple recordsets does not work correctly. For example, we have a lot queries that generate multiple recordsets, but only the final recordset is expected. This is not working using the SQL Server driver (although this works fine in ACF).

I’ve spent a ton of time trying to find solutions to these issues, but have come up empty.

So I thought I’d try upgrading the SQL Server version to 8.4.1 for JRE 11 to see if that would work, but I’m having issues.

I went and forked the extension-jdbc-mssql extension and did the following:

  • Gave a unique label & ID in the build.properties file
  • Replaced the org.lucee.mssql-7.2.0.0.jar with mssql-jdbc-8.4.1.jre11.jar.

Running the build.xml creates the LEX extension and it appears to install correctly, but it’s not working correctly. Even though the JAR gets copied to the server/lucee-server/bundles/ folder, it throws errors saying it cannot find the com.microsoft.sqlserver.jdbc.SQLServerDriver.

If I try to manually use createObject() it doesn’t find the class either, unless I specify the full path to the server/lucee-server/bundles/ folder, then it finds the class.

I can create other classes that are in JARs in the server/lucee-server/bundles/ folder, so I’m not sure why it’s not finding the files in my JAR file.

What might I be doing wrong?