protected virtual bool Authenticate(string defaultSchema, string username, string password) { if (CurrentState == ConnectorState.Authenticated && QueryContext != null) throw new InvalidOperationException("Already authenticated."); // TODO: Log a debug information // TODO: Log an information about the logging user... try { QueryContext = OnAuthenticate(defaultSchema, username, password); if (QueryContext == null) return false; QueryContext.AutoCommit(autoCommit); QueryContext.IgnoreIdentifiersCase(ignoreIdentifiersCase); QueryContext.ParameterStyle(parameterStyle); ChangeState(ConnectorState.Authenticated); return true; } catch (Exception e) { // TODO: throw server error throw; } }