Skip to content

12.6.3+ changed behavior on how it handles timezones for jdbcType TIMESTAMP #2490

@brentryan

Description

@brentryan

Driver version

12.6.3

We know that it works properly up until version 12.6.2.jre11 of the driver but this broke at some point after this version. We believe this is a breaking change that should be corrected.

SQL Server version

We’re using SQL Server 2019 and later

Client Operating System

Amazon Linux 2, MacOS M2

JAVA/JVM version

Java 11, Java 17 and Java 21

Table schema

See attached test case for full example scenario.

Problem description

When setting the value on a prepared statement as a string for a TIMESTAMP jdbc type, the expected string format seemed to have change between versions which breaks behavior of multiple use cases. We used to be able to use "yyyy-MM-dd'T'HH:mm:ss'Z'" and now it only works if you use "yyyy-MM-dd'T'HH:mm:ss".

See test case attached. You can execute this test using 12.6.2jre11 and you will see the test pass. If you then update it to 12.6.3.jre11 then you’ll see the test case fail.

Expected behavior

The test case passes or a MAJOR version bump is applied to the driver with breaking change documentation.

Actual behavior

The test fails because the JDBC driver is expecting a different format then it did previously.

How to reproduce

See mssql-jdbc-bug.zip file for full java project with unit test that reproduces this problem. Unzip project and utilize maven to run unit tests.

Note: This does require maven, java and docker desktop installed in order to successfully execute the tests.

mssql-jdbc-bug.zip

To see failing test run:

mvn test

To see passing test update the pom.xml file for the mssql-jdbc dependency to 12.6.2.jre11 and run:

mvn test

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Closed Issues

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions