Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLServerException return a null SQLState when trying to convert a date to a long datatype #2167

Open
ReneSvendsen opened this issue Jul 17, 2023 · 4 comments
Labels
Enhancement An enhancement to the driver. Lower priority than bugs.
Projects

Comments

@ReneSvendsen
Copy link

Driver version

12.2

SQL Server version

SQL Server 2017 - 14.0.2042.3 (x64)

Client Operating System

Provide the Operating System the client application is running on.

JAVA/JVM version

1.8.0.272

Problem description

When trying to convert a column read from a recordset using getLong() and the column being converted is a string date-representation the following (expected) error message is shown:

The conversion from datetime to BIGINT is unsupported.

However the SQLState is reported as 'null'

Expected behavior

When the exception is thrown the SQLState '22005' was expected.

Actual behavior

SQLState is reported as 'null'

When using the jtds driver the SQLState is reported correctly.

@tkyc
Copy link
Member

tkyc commented Jul 17, 2023

Thanks for letting us know. I'll need to attempt a repro to confirm this. I'll come back to this later and let you know as I'm in the middle of performing release tasks.

@lilgreenbird
Copy link
Member

hi @ReneSvendsen

It would help if you could include the code and schema you used to repro this issue?

Thanks.

@lilgreenbird lilgreenbird added this to Under Investigation in MSSQL JDBC via automation Jul 18, 2023
@lilgreenbird
Copy link
Member

hi @ReneSvendsen

are you able to provide us with a repro of the issue?

@lilgreenbird lilgreenbird moved this from Under Investigation to Waiting for Customer in MSSQL JDBC Aug 2, 2023
@tkyc
Copy link
Member

tkyc commented Aug 17, 2023

There's still more places in the driver where we are throwing null for the SQL state code. I'm marking this as an enhancement as we'll need to eventually resolve those as well.

@tkyc tkyc moved this from Waiting for Customer to Backlog in MSSQL JDBC Aug 17, 2023
@tkyc tkyc added the Enhancement An enhancement to the driver. Lower priority than bugs. label Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement An enhancement to the driver. Lower priority than bugs.
Projects
MSSQL JDBC
  
Backlog
Development

No branches or pull requests

3 participants