Package java.sql

Examples of java.sql.SQLIntegrityConstraintViolationException


            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,
                    severity, t);
        } else if (sqlState.startsWith(SQLState.AUTHORIZATION_SPEC_PREFIX)) {
            ex = new SQLInvalidAuthorizationSpecException(message, sqlState,
                    severity, t);
        }       
View Full Code Here


            //NonTransientConnectionException
            ex = new SQLTransientConnectionException(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_PREFIX)) {
            ex = new SQLInvalidAuthorizationSpecException(message, sqlState,
                    errCode);
        } else if (sqlState.startsWith(SQLState.TRANSACTION_PREFIX) ||
View Full Code Here

            ex = new SQLTransientConnectionException(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,
                    severity, t);
        } else if (sqlState.startsWith(SQLState.AUTHORIZATION_PREFIX)) {
            ex = new SQLInvalidAuthorizationSpecException(message, sqlState,
                    severity, t);
        }       
View Full Code Here

            ex = new SQLTransientConnectionException(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,
                    severity, t);
        } else if (sqlState.startsWith(SQLState.AUTHORIZATION_SPEC_PREFIX)) {
            ex = new SQLInvalidAuthorizationSpecException(message, sqlState,
                    severity, t);
        }       
View Full Code Here

            //NonTransientConnectionException
            ex = new SQLTransientConnectionException(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) ||
View Full Code Here

    }
   
    @Test
    public void uniqueConstraintOrIndexViolation() throws Exception {
        final String msg = "initial gumph: unique constraint or index violation; further details";
        final SQLIntegrityConstraintViolationException ex = new SQLIntegrityConstraintViolationException(msg);
        String recognize = exceptionRecognizer.recognize(ex);
        assertThat(recognize, is("Data already exists: " + msg));
    }
View Full Code Here

    }

    @Test
    public void notNullCheckConstraintViolation() throws Exception {
        final String msg = "initial gumph: NOT NULL check constraint; further details";
        final SQLIntegrityConstraintViolationException ex = new SQLIntegrityConstraintViolationException(msg);
        String recognize = exceptionRecognizer.recognize(ex);
        assertThat(recognize, is(nullValue()));
    }
View Full Code Here

    assertFalse(this.dialect.indicatesFailure(new SerialException()));
    assertFalse(this.dialect.indicatesFailure(new SQLClientInfoException()));
    assertFalse(this.dialect.indicatesFailure(new SQLNonTransientException()));
    assertFalse(this.dialect.indicatesFailure(new SQLDataException()));
    assertFalse(this.dialect.indicatesFailure(new SQLFeatureNotSupportedException()));
    assertFalse(this.dialect.indicatesFailure(new SQLIntegrityConstraintViolationException()));
    assertFalse(this.dialect.indicatesFailure(new SQLInvalidAuthorizationSpecException()));
    assertFalse(this.dialect.indicatesFailure(new SQLSyntaxErrorException()));
    assertFalse(this.dialect.indicatesFailure(new SQLRecoverableException()));
    assertFalse(this.dialect.indicatesFailure(new SQLTransientException()));
    assertFalse(this.dialect.indicatesFailure(new SQLTimeoutException()));
View Full Code Here

    assertFalse(this.dialect.indicatesFailure(new SerialException()));
    assertFalse(this.dialect.indicatesFailure(new SQLClientInfoException()));
    assertFalse(this.dialect.indicatesFailure(new SQLNonTransientException()));
    assertFalse(this.dialect.indicatesFailure(new SQLDataException()));
    assertFalse(this.dialect.indicatesFailure(new SQLFeatureNotSupportedException()));
    assertFalse(this.dialect.indicatesFailure(new SQLIntegrityConstraintViolationException()));
    assertFalse(this.dialect.indicatesFailure(new SQLInvalidAuthorizationSpecException()));
    assertFalse(this.dialect.indicatesFailure(new SQLSyntaxErrorException()));
    assertFalse(this.dialect.indicatesFailure(new SQLRecoverableException()));
    assertFalse(this.dialect.indicatesFailure(new SQLTransientException()));
    assertFalse(this.dialect.indicatesFailure(new SQLTimeoutException()));
View Full Code Here

                        code, cause);
            }
        } else if (sqlstate.startsWith("22")) {
            return new SQLDataException(msg, sqlstate, code, cause);
        } else if (sqlstate.startsWith("23")) {
            return new SQLIntegrityConstraintViolationException(msg, sqlstate,
                    code, cause);
        } else if (sqlstate.startsWith("28")) {
            return new SQLInvalidAuthorizationSpecException(msg, sqlstate,
                    code, cause);
        } else if (sqlstate.startsWith("42") || sqlstate.startsWith("37")
View Full Code Here

TOP

Related Classes of java.sql.SQLIntegrityConstraintViolationException

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.