public virtual Throwable Next() { Throwable throwable = null; if (firstException != null) { throwable = firstException; firstException = null; } else if (cause != null) { throwable = cause; cause = cause.Cause; } else if (nextException != null) { throwable = nextException; cause = nextException.Cause; nextException = nextException.NextException; } else { throw new NoSuchElementException(); } return(throwable); }
public IteratorAnonymousInnerClassHelper(SQLException outerInstance) { this.OuterInstance = outerInstance; firstException = outerInstance; nextException = firstException.NextException; cause = firstException.Cause; }
protected AbstractDbErrorCollection(SQLException e, AbstractDBConnection connection) { _list = new ArrayList(); while(e != null) { _list.Add(CreateDbError(e, connection)); e = e.getNextException(); } }
protected sealed override SystemException CreateException(string message, SQLException e) { return new OracleException(message,e, (OracleConnection)_command.Connection); }
internal SqlException(string message, SQLException cause, SqlConnection connection) : base(message, cause, connection) {}
/** * Initialize SqlError object * */ internal SqlError(SQLException e, AbstractDBConnection connection) : base(e, connection) { if (connection != null) _serverVersion = connection.ServerVersion; }
internal OracleException(string message, SQLException cause, OracleConnection connection) : base(message, cause, connection) {}
protected sealed override SystemException CreateException(SQLException e) { return new SqlException(e, this); }
protected abstract SystemException CreateException(string message, SQLException e);
internal OracleErrorCollection(SQLException e, AbstractDBConnection connection) : base(e, connection) { }
protected override AbstractDbError CreateDbError(java.sql.SQLException e, AbstractDBConnection connection) { return(new SqlError(e, connection)); }
protected abstract AbstractDbError CreateDbError(SQLException e, AbstractDBConnection connection);
internal OleDbError(SQLException e, AbstractDBConnection connection) : base(e, connection) { }
internal protected virtual void OnSqlException(SQLException exp) { throw CreateException(exp); }
protected abstract SystemException CreateException(SQLException e);
protected AbstractDbException(SQLException cause, AbstractDBConnection connection) : this(String.Empty, cause, connection) {}
protected AbstractDbException(string message, SQLException cause, AbstractDBConnection connection) : base(message, cause) { _connection = connection; _cause = cause; }
protected override AbstractDbError CreateDbError(SQLException e, AbstractDBConnection connection) { return new OracleError(e, connection); }
protected SystemException CreateException(SQLException e) { return CreateException(e.Message,e); }
internal OleDbExceptionImpl(SQLException cause, OleDbConnection connection) : base(cause, connection) {}
internal OracleException(SQLException cause, OracleConnection connection) : base(cause, connection) {}
internal OleDbExceptionImpl(string message, SQLException cause, OleDbConnection connection) : base(message, cause, connection) {}
protected AbstractDbError(SQLException e, AbstractDBConnection connection) { _e = e; if (connection != null) _jdbcProvider = connection.JdbcProvider; }
// Worker method called by the public getConnection() methods. //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: private static Connection getConnection(String url, java.util.Properties info, Class caller) throws SQLException private static Connection GetConnection(String url, java.util.Properties info, Class caller) { /* * When callerCl is null, we should check the application's * (which is invoking this class indirectly) * classloader, so that the JDBC driver class outside rt.jar * can be loaded from here. */ ClassLoader callerCL = caller != null ? caller.ClassLoader : null; lock (typeof(DriverManager)) { // synchronize loading of the correct classloader. if (callerCL == null) { callerCL = Thread.CurrentThread.ContextClassLoader; } } if (url == null) { throw new SQLException("The url cannot be null", "08001"); } Println("DriverManager.getConnection(\"" + url + "\")"); // Walk through the loaded registeredDrivers attempting to make a connection. // Remember the first exception that gets raised so we can reraise it. SQLException reason = null; foreach (DriverInfo aDriver in RegisteredDrivers) { // If the caller does not have permission to load the driver then // skip it. if (IsDriverAllowed(aDriver.Driver, callerCL)) { try { //JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method: Println(" trying " + aDriver.Driver.GetType().FullName); Connection con = aDriver.Driver.Connect(url, info); if (con != null) { // Success! //JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method: Println("getConnection returning " + aDriver.Driver.GetType().FullName); return(con); } } catch (SQLException ex) { if (reason == null) { reason = ex; } } } else { //JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method: Println(" skipping: " + aDriver.GetType().FullName); } } // if we got here nobody could connect. if (reason != null) { Println("getConnection failed: " + reason); throw reason; } Println("getConnection: no suitable driver found for " + url); throw new SQLException("No suitable driver found for " + url, "08001"); }
protected internal sealed override SystemException CreateException(SQLException e) { return new OleDbException(e,Connection); }
internal SqlException(SQLException cause, SqlConnection connection) : base(cause, connection) {}