Inheritance: java.lang.Exception, java.lang.Iterable
コード例 #1
0
            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);
            }
コード例 #2
0
 public IteratorAnonymousInnerClassHelper(SQLException outerInstance)
 {
     this.OuterInstance = outerInstance;
     firstException     = outerInstance;
     nextException      = firstException.NextException;
     cause = firstException.Cause;
 }
コード例 #3
0
		protected AbstractDbErrorCollection(SQLException e, AbstractDBConnection connection) {
			_list = new ArrayList();

			while(e != null) {
				_list.Add(CreateDbError(e, connection));
				e = e.getNextException();
			}
		}
コード例 #4
0
		protected sealed override SystemException CreateException(string message, SQLException e) {
			return new OracleException(message,e, (OracleConnection)_command.Connection);		
		}
コード例 #5
0
ファイル: SqlException.cs プロジェクト: carrie901/mono
		internal SqlException(string message, SQLException cause, SqlConnection connection) : base(message, cause, connection) {}
コード例 #6
0
        /**
         * Initialize SqlError object
         * */
        internal SqlError(SQLException e, AbstractDBConnection connection) : base(e, connection)
        {
			if (connection != null)
				_serverVersion = connection.ServerVersion;
        }
コード例 #7
0
ファイル: OracleException.cs プロジェクト: runefs/Marvin
		internal OracleException(string message, SQLException cause, OracleConnection connection) : base(message, cause, connection) {}
コード例 #8
0
		protected sealed override SystemException CreateException(SQLException e)
		{
			return new SqlException(e, this);		
		}
コード例 #9
0
		protected abstract SystemException CreateException(string message, SQLException e);
コード例 #10
0
		internal OracleErrorCollection(SQLException e, AbstractDBConnection connection) : base(e, connection) {
		}
コード例 #11
0
 protected override AbstractDbError CreateDbError(java.sql.SQLException e, AbstractDBConnection connection)
 {
     return(new SqlError(e, connection));
 }
コード例 #12
0
		protected abstract AbstractDbError CreateDbError(SQLException e, AbstractDBConnection connection);
コード例 #13
0
ファイル: OleDbError.cs プロジェクト: GirlD/mono
		internal OleDbError(SQLException e, AbstractDBConnection connection) : base(e, connection) {
		}
コード例 #14
0
ファイル: AbstractDBConnection.cs プロジェクト: runefs/Marvin
		internal protected virtual void OnSqlException(SQLException exp)
		{
			throw CreateException(exp);
		}
コード例 #15
0
ファイル: AbstractDBConnection.cs プロジェクト: runefs/Marvin
		protected abstract SystemException CreateException(SQLException e);
コード例 #16
0
		protected AbstractDbException(SQLException cause, AbstractDBConnection connection) : this(String.Empty, cause, connection) {}
コード例 #17
0
		protected AbstractDbException(string message, SQLException cause, AbstractDBConnection connection) : base(message, cause) {
			_connection = connection;
			_cause = cause;
		}
コード例 #18
0
		protected override AbstractDbError CreateDbError(SQLException e, AbstractDBConnection connection) {
			return new OracleError(e, connection);
		}
コード例 #19
0
		protected SystemException CreateException(SQLException e)
		{
			return CreateException(e.Message,e);	
		}
コード例 #20
0
			internal OleDbExceptionImpl(SQLException cause, OleDbConnection connection) : base(cause, connection) {}
コード例 #21
0
ファイル: OracleException.cs プロジェクト: runefs/Marvin
		internal OracleException(SQLException cause, OracleConnection connection) : base(cause, connection) {}
コード例 #22
0
			internal OleDbExceptionImpl(string message, SQLException cause, OleDbConnection connection) : base(message, cause, connection) {}
コード例 #23
0
		protected AbstractDbError(SQLException e, AbstractDBConnection connection) {
			_e = e;
			if (connection != null)
				_jdbcProvider = connection.JdbcProvider;
		}
コード例 #24
0
        //  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");
        }
コード例 #25
0
		protected internal sealed override SystemException CreateException(SQLException e)
		{
			return new OleDbException(e,Connection);		
		}
コード例 #26
0
ファイル: SqlException.cs プロジェクト: carrie901/mono
		internal SqlException(SQLException cause, SqlConnection connection) : base(cause, connection) {}