Skip to content

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

@ReneSvendsen

Description

@ReneSvendsen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementAn enhancement to the driver. Lower priority than bugs.

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions