Skip to content

Commit

Permalink
Merge pull request #522 from cheenamalhotra/throwAccountLockedEx
Browse files Browse the repository at this point in the history
Throw exception for "Account Locked" SQL Exception 18486
  • Loading branch information
cheenamalhotra authored Nov 15, 2017
2 parents 4be9856 + 4a1409a commit be14e88
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1991,6 +1991,7 @@ else if (null == currentPrimaryPlaceHolder) {
catch (SQLServerException sqlex) {
if ((SQLServerException.LOGON_FAILED == sqlex.getErrorCode()) // actual logon failed, i.e. bad password
|| (SQLServerException.PASSWORD_EXPIRED == sqlex.getErrorCode()) // actual logon failed, i.e. password isExpired
|| (SQLServerException.USER_ACCOUNT_LOCKED == sqlex.getErrorCode()) // actual logon failed, i.e. user account locked
|| (SQLServerException.DRIVER_ERROR_INVALID_TDS == sqlex.getDriverErrorCode()) // invalid TDS received from server
|| (SQLServerException.DRIVER_ERROR_SSL_FAILED == sqlex.getDriverErrorCode()) // failure negotiating SSL
|| (SQLServerException.DRIVER_ERROR_INTERMITTENT_TLS_FAILED == sqlex.getDriverErrorCode()) // failure TLS1.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public final class SQLServerException extends java.sql.SQLException {
// SQL error values (from sqlerrorcodes.h)
static final int LOGON_FAILED = 18456;
static final int PASSWORD_EXPIRED = 18488;
static final int USER_ACCOUNT_LOCKED = 18486;
static java.util.logging.Logger exLogger = java.util.logging.Logger.getLogger("com.microsoft.sqlserver.jdbc.internals.SQLServerException");

// Facility for driver-specific error codes
Expand Down

0 comments on commit be14e88

Please sign in to comment.