checkUserPassword(user_, password);
flowUSRSSBPWDconnect(password);
break;
default:
throw new SqlException(agent_.logWriter_,
new ClientMessageId(SQLState.SECMECH_NOT_SUPPORTED),
new Integer(securityMechanism));
}
} catch (java.lang.Throwable e) { // if *anything* goes wrong, make sure the connection is destroyed
// always mark the connection closed in case of an error.
// This prevents attempts to use this closed connection
// to retrieve error message text if an error SQLCA
// is returned in one of the connect flows.
open_ = false;
// logWriter may be closed in agent_.close(),
// so SqlException needs to be created before that
// but to be thrown after.
SqlException exceptionToBeThrown;
if (e instanceof SqlException) // rethrow original exception if it's an SqlException
{
exceptionToBeThrown = (SqlException) e;
} else // any other exceptions will be wrapped by an SqlException first
{
exceptionToBeThrown = new SqlException(agent_.logWriter_,
new ClientMessageId(SQLState.JAVA_EXCEPTION),
e.getClass().getName(), e.getMessage(), e);
}
try {