Package java.sql

Examples of java.sql.SQLNonTransientConnectionException


        final SQLException ex;
        if (sqlState.startsWith(SQLState.CONNECTIVITY_PREFIX)) {
            //none of the sqlstate supported by derby belongs to
            //TransientConnectionException DERBY-3074
            ex = new SQLNonTransientConnectionException(message, sqlState,
                    severity, t);
        } else if (sqlState.startsWith(SQLState.SQL_DATA_PREFIX)) {
            ex = new SQLDataException(message, sqlState, severity, t);
        } else if (sqlState.startsWith(SQLState.INTEGRITY_VIOLATION_PREFIX)) {
            ex = new SQLIntegrityConstraintViolationException(message, sqlState,
View Full Code Here


  }
 
  @Test
  public void indicatesFailureSQLException()
  {
    assertTrue(this.dialect.indicatesFailure(new SQLNonTransientConnectionException()));
    assertTrue(this.dialect.indicatesFailure(new SQLTransientConnectionException()));
    int i = 0;
    char[] alphabet = new char[36];
    for (char c = '0'; c <= '9'; ++c)
    {
View Full Code Here

  }
 
  @Test
  public void indicatesFailureSQLException()
  {
    assertTrue(this.dialect.indicatesFailure(new SQLNonTransientConnectionException()));
    assertTrue(this.dialect.indicatesFailure(new SQLTransientConnectionException()));
    int i = 0;
    char[] alphabet = new char[36];
    for (char c = '0'; c <= '9'; ++c)
    {
View Full Code Here

    }

    public static SQLException sqlException(Throwable t) {

//#ifdef JAVA6
        return new SQLNonTransientConnectionException(t);

//#else
/*
        return new SQLException(t.getMessage(),
                                Error.getStateString(ErrorCode.GENERAL_ERROR),
View Full Code Here

                        code, cause);
            } else {

                // the database is (permanently) shut down or the connection is
                // (permanently) closed or broken
                return new SQLNonTransientConnectionException(msg, sqlstate,
                        code, cause);
            }
        } else if (sqlstate.startsWith("22")) {
            return new SQLDataException(msg, sqlstate, code, cause);
        } else if (sqlstate.startsWith("23")) {
View Full Code Here

        if (sqlState == null) {
            ex = new SQLException(message, sqlState, errCode);
        } else if (sqlState.startsWith(SQLState.CONNECTIVITY_PREFIX)) {
            //none of the sqlstate supported by derby belongs to
            //TransientConnectionException. DERBY-3075
            ex = new SQLNonTransientConnectionException(message, sqlState, errCode);
        } else if (sqlState.startsWith(SQLState.SQL_DATA_PREFIX)) {
            ex = new SQLDataException(message, sqlState, errCode);
        } else if (sqlState.startsWith(SQLState.INTEGRITY_VIOLATION_PREFIX)) {
            ex = new SQLIntegrityConstraintViolationException(message, sqlState,
                    errCode);
        } else if (sqlState.startsWith(SQLState.AUTHORIZATION_SPEC_PREFIX)) {
            ex = new SQLInvalidAuthorizationSpecException(message, sqlState,
                    errCode);
        } else if (sqlState.startsWith(SQLState.TRANSACTION_PREFIX)) {
            ex = new SQLTransactionRollbackException(message, sqlState,
                    errCode);
        } else if (sqlState.startsWith(SQLState.LSE_COMPILATION_PREFIX)) {
            ex = new SQLSyntaxErrorException(message, sqlState, errCode);
        } else if (
            sqlState.startsWith (SQLState.UNSUPPORTED_PREFIX)   ||
            sqlState.equals(DRDA_COMMAND_NOT_SUPPORTED)         ||
            sqlState.equals(DRDA_OBJECT_NOT_SUPPORTED)          ||
            sqlState.equals(DRDA_PARAM_NOT_SUPPORTED)           ||
            sqlState.equals(DRDA_VALUE_NOT_SUPPORTED)           ||
            sqlState.equals(DRDA_SQLTYPE_NOT_SUPPORTED)         ||
            sqlState.equals(DRDA_REPLY_MSG_NOT_SUPPORTED)           ) {
            ex = new SQLFeatureNotSupportedException(message, sqlState,
                    errCode);
        } else if
                (
                 sqlState.equals(SQLState.LANG_STATEMENT_CANCELLED_OR_TIMED_OUT.substring(0, 5)) ||
                 sqlState.equals(SQLState.LOGIN_TIMEOUT.substring(0, 5))
                 ) {
            ex = new SQLTimeoutException(message, sqlState, errCode);
        }
        // If the sub-class cannot be determined based on the SQLState, use
        // the severity instead.
        else if (errCode >= ExceptionSeverity.SESSION_SEVERITY) {
            ex = new SQLNonTransientConnectionException(
                    message, sqlState, errCode);
        } else if (errCode >= ExceptionSeverity.TRANSACTION_SEVERITY) {
            ex = new SQLTransactionRollbackException(
                    message, sqlState, errCode);
        }
View Full Code Here

        final SQLException ex;
        if (sqlState.startsWith(SQLState.CONNECTIVITY_PREFIX)) {
            //no derby sqlstate belongs to
            //TransientConnectionException DERBY-3074
            ex = new SQLNonTransientConnectionException(
                    message, sqlState, severity, ferry);
        } else if (sqlState.startsWith(SQLState.SQL_DATA_PREFIX)) {
            ex = new SQLDataException(message, sqlState, severity, ferry);
        } else if (sqlState.startsWith(SQLState.INTEGRITY_VIOLATION_PREFIX)) {
            ex = new SQLIntegrityConstraintViolationException(message, sqlState,
View Full Code Here

        final SQLException ex;
        if (sqlState.startsWith(SQLState.CONNECTIVITY_PREFIX)) {
            //none of the sqlstate supported by derby belongs to
            //TransientConnectionException DERBY-3074
            ex = new SQLNonTransientConnectionException(message, sqlState,
                    severity, t);
        } else if (sqlState.startsWith(SQLState.SQL_DATA_PREFIX)) {
            ex = new SQLDataException(message, sqlState, severity, t);
        } else if (sqlState.startsWith(SQLState.INTEGRITY_VIOLATION_PREFIX)) {
            ex = new SQLIntegrityConstraintViolationException(message, sqlState,
View Full Code Here

    }

    public static SQLException sqlException(Throwable t) {

//#ifdef JAVA6
        return new SQLNonTransientConnectionException(t);

//#else
/*
        return new SQLException(t.getMessage(),
                                Error.getStateString(ErrorCode.GENERAL_ERROR),
View Full Code Here

                        code, cause);
            } else {

                // the database is (permanently) shut down or the connection is
                // (permanently) closed or broken
                return new SQLNonTransientConnectionException(msg, sqlstate,
                        code, cause);
            }
        } else if (sqlstate.startsWith("22")) {
            return new SQLDataException(msg, sqlstate, code, cause);
        } else if (sqlstate.startsWith("23")) {
View Full Code Here

TOP

Related Classes of java.sql.SQLNonTransientConnectionException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.