code: boolean isAuthException(SQLException x) {
          return x instanceof SQLInvalidAuthorizationSpecException
                 || x.getSQLState() != null && x.getSQLState().startsWith("28");
      }
docs: Determine if the top level exception is an authorization exception.
  Chained exceptions are not checked.
  
  In the generic case, look for the JDBC 4.0 exception subclass
  or the 28xxx SQLState (Invalid authorization specification)
  
  @param x the exception to check.
  @return true or false to indicate if the exception is an authorization error.
  @throws NullPointerException if a NULL exception parameter is supplied.