eclipse-vertx/vertx-sql-client

DatabaseException#getSqlState is null for MS SQL Server

DavideD opened this issue · 2 comments

When a new MSSQLException is created, the value of DatabaseException#sqlState is always set to null.

See

super(formatMessage(number, state, severity, errorMessage, serverName, procedureName, lineNumber), number, null);

The MSSQL JdbcDriver actually has a method to convert the vendor code to the sql state code: https://github.com/microsoft/mssql-jdbc/blob/ebf4d78eb985c7759cc74d4eb3c0de8cd010387d/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerException.java#L333

I think I can send a fix for this

Fixed in 4.x branch by 8a0db88