Repository navigation
Description
Problem
We bundle two SQL Server JDBC drivers: jTDS 1.3.1 and Microsoft's mssql-jdbc. jTDS is still the default for database = sqlserver, but it has had no release since 2013. It also needs a patched copy of one of its classes in our source tree (net.sourceforge.jtds.ssl.TdsTlsOutputStream, LGPL) to work around an unfixed TLS handshake bug (jTDS bugs/725, patches/129). It does not implement JDBC 4 methods such as isValid(), which is why DatabaseSettings special-cases sqlserver as non-JDBC4.
The Microsoft driver is maintained, handles current TLS itself, is MIT licensed, and is already shipped. #592 upgrades it from 10.2.4 to 13.6.2 and adds smoke-test coverage for it, which didn't exist before.
Proposal
Make the Microsoft driver the only bundled SQL Server driver, in two steps across two releases so existing installs aren't broken.
Phase A: switch the default and deprecate jTDS (jTDS jar still bundled)
database = sqlservermaps to the Microsoft driver, except that an existing config with ajdbc:jtds:URL and nodatabase.driverkeeps using jTDS and logs a deprecation warning. The warning is only a warning; the URL is not rewritten, because the properties file is the user's and the Microsoft driver has different URL syntax and encryption defaults.- The JDBC4 flag and test query are derived from the driver actually in use instead of from the
databasename. Today they follow the name, so an explicit jTDSdatabase.driverwould break oncesqlserveris marked JDBC4. - jTDS is marked deprecated in the shipped driver list, the reference list and
mirth.properties, and the Microsoft entry goes first. Existing installs keep their stored driver list.
Phase B: remove (a later release)
- Remove the jTDS jars, the
TdsTlsOutputStreamoverride, the jTDS CI configuration, the jTDS entries and notices, and the jTDS-specific branch inDatabaseSettings. - A jTDS user can still supply the jar themselves. For the engine's own database that means
custom-libplus an explicitdatabase.driver; for Database Reader/Writer channels a library resource. Stock jTDS lacks our TLS patch, so TLS handshakes against newer SQL Server versions may fail.
What changes for users
- Existing jTDS installs keep working through Phase A, with a warning. In Phase B they need to switch to the Microsoft driver or add the jTDS jar themselves.
- The URL syntax differs:
jdbc:jtds:sqlserver://host:port/dbbecomesjdbc:sqlserver://host:port;databaseName=db. - The Microsoft driver has defaulted to
encrypt=truesince 10.2.0, which 4.7.0 already ships. For anyone switching from jTDS this is new, so servers with self-signed certificates needtrustServerCertificate=trueor a proper trust store. - The Microsoft driver sends
Timestampparameters asdatetime2, jTDS asdatetime. Claude checked this against SQL Server 2025 with jTDS 1.3.1, mssql-jdbc 10.2.4 and 13.6.2: values stored inDATETIMEcolumns and read back are identical, and index seeks are unaffected. Comparisons differ when the parameter's milliseconds are not exactly representable inDATETIME(which only has .000, .003 and .007 steps):WHERE ts = ?stops matching rows that jTDS matched, and an inclusive upper bound ending in .999 can miss a row stored as the next whole second. Our own queries only use>=,<=and<on these columns, so only rows within a few milliseconds of a bound are affected, but custom metadata searches using equals/not equals on timestamp columns and user SQL are exposed. AddingdatetimeParameterType=datetimeto the URL gave results identical to jTDS in every case. The results were the same on SQL Server 2022 CU27. - Channels and scripts that hard-code
net.sourceforge.jtds.jdbc.Driveror ajdbc:jtds:URL are not migrated automatically. - Sybase is not supported by the Microsoft driver. I'm not aware of anyone using it through jTDS.
Open questions
- Are there Sybase or jTDS users who would object? Please say so here.
- Leave existing stored driver-list entries alone, or add a migration that removes only the entry matching the shipped jTDS default in Phase B?
- Should the Microsoft URL template and examples include
datetimeParameterType=datetime? See theDATETIMEnote above.
Tasks
- Upgrade mssql-jdbc to 13.6.2 and add a smoke-test configuration for it #592 Upgrade mssql-jdbc to 13.6.2 and add its smoke-test configuration (prerequisite)
- Phase A: URL-aware default driver, JDBC4 flag derived from the driver, and the deprecation warning
- Phase A: driver list, reference list and
mirth.propertiesdocumentation - Check
DATETIME/datetime2behavior (done on SQL Server 2022 and 2025) - Phase B: remove the jars, the override, the CI configuration and the notices
🤖 Drafted with Claude Code
Activity
mgaffigan commentedon Nov 23, 2026
I don't see this as a big enough issue to split in two. Kill it. It's easily reversible if someone has some super odd corner case - but I see no point in supporting/shipping both. It's an option without value. The "trustServerCertificate" option is de rigeur to an SQL Server admin for the past few years, most apps have already made that leap.
tonygermano commentedon Nov 23, 2026
It's actually not easily reversible because of several items detailed in this issue. As the removal of this default driver is not a critically urgent issue, I don't see a reason to not deprecate it for a release cycle before we remove it to let people prepare for the change. Splitting it into two phases allows the preliminary work to allow people to roll it back to be in the same release as the deprecation announcement.
mgaffigan commentedon Nov 23, 2026
That sounds like a reason to fix the SQL server detection logic, not to give two options. I would put $50 on no one needing this - and it only delaying pain and causing confusion.
What's the benefit over killing it in two phases instead of one? (I take as granted fixing the detection). What do we gain?
jonbartels commentedon Nov 23, 2026
Is there any plausible condition where the JTDS driver would work but the MS driver would not work? Something like the MS driver not working on older SQL Server installs but the JTDS driver working?
Even if those cases exist - What would a user need to do if they really really really needed to use JTDS? Load the custom driver, setup the driver mapping, and what else?
JTDS has been deprecated for a while, even within the old Mirth community it was getting flagged as just not working for many modern SQL Server connections - https://github.com/search?q=repo%3Anextgenhealthcare%2Fconnect+jtds&type=discussions
The user base that is potentially negatively impacted are users who have an older (or deconfigured) SQL Server installation that somehow needs the JTDS driver. My instinct is that those users are a very small population and a population that is already facing a mountain of upgrades and tech debt.