Skip to content

Upgrade mssql-jdbc to 13.6.2 and add a smoke-test configuration for it - #592

Open
tonygermano wants to merge 2 commits into
OpenIntegrationEngine:mainfrom
tonygermano:build/mssql-jdbc-13.6.2
Open

tonygermano wants to merge 2 commits into
OpenIntegrationEngine:mainfrom
tonygermano:build/mssql-jdbc-13.6.2

Conversation

@tonygermano

@tonygermano tonygermano commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Upgrades the bundled Microsoft SQL Server JDBC driver from 10.2.4.jre11 to 13.6.2.jre11, the current stable release. It also adds CI coverage for the driver, which had none.

The configuration commit comes first so the existing smoke tests were run against the old driver through the new configuration before the upgrade.

CI coverage

The existing sqlserver smoke-test configuration connects through jTDS, so mssql-jdbc was never loaded in CI.

  • New alpine-temurin21-sqlserver-mssql-jdbc configuration: the Microsoft driver against SQL Server 2025. It sets database.driver through _MP_DATABASE_DRIVER and uses a jdbc:sqlserver URL with trustServerCertificate=true for the container's self-signed certificate.
  • The existing jTDS configuration moves from SQL Server 2025 to 2022. 2022 is still widely deployed, and this keeps jTDS covered while it heads toward deprecation.

There is no 2022 leg for the Microsoft driver: the smoke tests read column metadata with SELECT * ... WHERE 1 = 0 and never reach DatabaseMetaData.getColumns, so they cannot tell the two server versions apart for this driver.

Driver upgrade

  • The jre11 build is the one Microsoft publishes for Java 11 and later; there are no jre17 or jre21 builds.
  • OSV lists no advisories for either version, so this is a currency upgrade, not a security fix.
  • The driver's runtime dependencies are all optional, so no packages are added.
  • Bouncy Castle is only used for client certificate authentication and Always Encrypted with secure enclaves. The driver's pom names jdk15on artifacts in 10.2.4 and jdk18on in 13.6.2, but both versions call the same classes, so the bundled jdk18on 1.78.1 jars (the driver is built against 1.84) serve both. Claude checked that 10.2.4 and 13.6.2 each load encrypted and unencrypted PEM private keys with only the bundled jars, and did not test the enclave feature, which also needs the unbundled gson.

Behavior changes for existing connections

The driver changelog from 10.2.4 to 13.6.0 lists these changes that could affect existing installations:

  • loginTimeout now defaults to 30 seconds (it was 15), and during login socketTimeout is capped at loginTimeout. A server that accepts the connection but never answers now fails the login at the timeout; before, the login could wait indefinitely.
  • getReference() no longer includes sensitive connection properties (JNDI use only).
  • getProcedures and getFunctions filter on sys.all_objects, and getColumns prefers sp_columns_170 on SQL Server 2025, falling back to sp_columns_100.
  • ActiveDirectoryPassword authentication logs a deprecation warning.

encrypt=true has been the default since 10.2.0, so it does not change. The driver's changelog has no entries for 13.6.1 and 13.6.2, so any changes in those two patch releases are unchecked.

Claude checked

  • ./gradlew --write-verification-metadata sha256 build dist -PdisableSigning=true -Pcoverage=true with a cold cache passed with the new version, and the dist bundles mssql-jdbc-13.6.2.jre11.jar.
  • ci/runtests.sh alpine-temurin21-sqlserver-mssql-jdbc passes all 47 tests against SQL Server 2025 with 10.2.4 (after the first commit) and again with 13.6.2.
  • ci/runtests.sh alpine-temurin21-sqlserver (jTDS) passes all 47 tests against SQL Server 2022.
  • Claude has not run ./gradlew clean build with all tests after splitting the commits, and has not tested against a SQL Server older than 2022.

Release Note

Microsoft SQL Server JDBC driver updated from 10.2.4 to 13.6.2

The Microsoft SQL Server driver (com.microsoft.sqlserver.jdbc.SQLServerDriver) bundled in server-lib/database is now 13.6.2. The jTDS driver, which database = sqlserver still uses by default, is unchanged. The changes below affect connections that use the Microsoft driver, such as a Database Reader or Writer, or the engine's own database when database.driver is set to it.

  • The default loginTimeout is now 30 seconds instead of 15. A server that accepts the connection but never answers now fails the login at the timeout (30 seconds, or the loginTimeout=<seconds> set in the connection URL); before, the login could wait indefinitely.
  • getProcedures and getFunctions now return only stored procedures and functions, and getColumns uses a newer system procedure on SQL Server 2025.
  • ActiveDirectoryPassword authentication now logs a deprecation warning.

Encryption was already on by default (encrypt=true) in 10.2.4, so a connection that worked before still needs a trusted certificate or trustServerCertificate=true, as before.


🤖 Drafted with Claude Code

The sqlserver configuration connects through jTDS, so mssql-jdbc is
never loaded in CI. Add a configuration that sets database.driver to
com.microsoft.sqlserver.jdbc.SQLServerDriver (via _MP_DATABASE_DRIVER,
since configure-from-env has no dedicated variable) and uses a
jdbc:sqlserver URL. encrypt=true is the driver default, so the URL
sets trustServerCertificate=true for the container's self-signed
certificate. The harness's DatabaseMetadataTest uses the same driver
and URL.

Run the Microsoft driver against SQL Server 2025 and move the jTDS
configuration to SQL Server 2022, which is still widely deployed and
keeps jTDS covered while it heads toward deprecation.
Both configurations pass all 47 tests with mssql-jdbc 10.2.4.

Assisted-by: Claude:claude-sonnet-5-5
Signed-off-by: Tony Germano <tony@germano.name>
@tonygermano
tonygermano requested a review from a team November 20, 2026 14:21
@tonygermano tonygermano added dependencies Dependency updates java Java / Gradle dependencies labels Nov 20, 2026
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Test Results

  147 files  + 1    147 suites  +1   4m 46s ⏱️ + 1m 7s
  991 tests ± 0    991 ✅ ± 0  0 💤 ±0  0 ❌ ±0 
1 362 runs  +53  1 356 ✅ +53  6 💤 ±0  0 ❌ ±0 

Results for commit a974191. ± Comparison against base commit 1e014f0.

♻️ This comment has been updated with latest results.

Comment on lines +39 to +40
DATABASE_URL: jdbc:sqlserver://db:1433;databaseName=mirthdb;encrypt=true;trustServerCertificate=true
_MP_DATABASE_DRIVER: com.microsoft.sqlserver.jdbc.SQLServerDriver

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change the existing smoke test and drop support for the old one instead? I don't think we need multiple for this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what I put in the PR description about that change

The existing jTDS configuration moves from SQL Server 2025 to 2022. 2022 is still widely deployed, and this keeps jTDS covered while it heads toward deprecation.

jTDS is still the default driver, so I didn't want to remove it from the smoke tests yet, but I figured it would get phased out eventually. Would you prefer I drop it from the smoke test now? I at least made it so each driver was running against a different version of SQL Server.

@pacmano1

Copy link
Copy Markdown
Contributor

Two of the release note bullets don't match what the driver does. I ran 13.6.2 against the same build with 10.2.4 swapped back in, from channel scripts in the engine, against SQL Server 2017, 2019, 2022 and 2025.

setObject with a length: neither version throws or truncates. setObject(1, "abcdefghij", Types.VARCHAR, 5) stores all 10 characters on both, and the same goes for NVARCHAR and for VARBINARY with a length of 3. Per the changelog, the throw came in with the 13.5.1 preview and 13.6.0 took it back out (microsoft/mssql-jdbc#3026, "Make setObject scaleOrLength an Advisory Hint"). I'd drop the bullet.

loginTimeout: failures got faster, not slower.

  • Address that doesn't answer: 15 s on 10.2.4, 8 s on 13.6.2.
  • Server that accepts the connection and never responds: 10.2.4 never gave up, with or without loginTimeout=5, until I dropped the connection at 7 minutes. 13.6.2 fails at 30 s, or 5 s with loginTimeout=5.

That second one is a fix and worth keeping in the note.

The rest matched between the two drivers. The engine runs on its own database on all four server versions (fresh install, messages, restart), Database Reader output is byte-identical across 24 column types, and the Database Writer behaves the same. A full build with tests passes in a fresh container.

Co-authored with Claude Code.

Move to the current stable release (13.6.2.jre11, released 2026-11-02).
The jre11 build is the one Microsoft publishes for Java 11 and later.
OSV lists no advisories for either version, so this is a currency
upgrade, not a security fix. The driver's runtime dependencies are all
optional, so no further packages are added.

Behavior changes since 10.2.4 that can affect existing connections:
- loginTimeout now defaults to 30 seconds (it was 15), and during
  login socketTimeout is capped at loginTimeout. A server that accepts
  the connection but never answers now fails the login at the timeout
  instead of waiting indefinitely.
- getReference() no longer includes sensitive connection properties.
- getProcedures and getFunctions filter on sys.all_objects, and
  getColumns prefers sp_columns_170 on SQL Server 2025, falling back
  to sp_columns_100.
encrypt=true has been the default since 10.2.0, so it does not change.

Verified with the sqlserver-mssql-jdbc smoke-test configuration
against SQL Server 2025: all 47 tests pass.

Assisted-by: Claude:claude-sonnet-5-5
Signed-off-by: Tony Germano <tony@germano.name>
@tonygermano
tonygermano force-pushed the build/mssql-jdbc-13.6.2 branch from f3c42b0 to a974191 Compare November 22, 2026 13:54
@tonygermano

Copy link
Copy Markdown
Member Author

@pacmano1 Thanks for testing this against four SQL Server versions, and you're right about both bullets.

setObject: the changelog lists the throw under the 13.5.1 preview and #3026 ("Make setObject scaleOrLength an Advisory Hint") in 13.6.0, which replaces it. I read the preview entry as if it were final. I've dropped the bullet from the release note and from the commit message.

loginTimeout: I had it backwards, because I read the 15 to 30 second change as slower failure and didn't consider a server that accepts the connection and never answers. I've rewritten the bullet to say that such a login now fails at the timeout instead of waiting indefinitely. That rests on your measurement, since I haven't reproduced it, but it matches the 13.x changelog entry that makes loginTimeout bound the socket reads when socketTimeout is 0.

I've pushed the amended commit message and updated the PR description and release note.


🤖 Drafted with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Dependency updates java Java / Gradle dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants