Package java.sql

Examples of java.sql.SQLDataException


    }
   
    @Test
    public void testMatchesCorrectExceptionStrategyUsingGroovyExpressionEvaluator() throws Exception
    {
        callVmAndThrowException("groovy", new SQLDataException(), "groovy catch-6");
    }
View Full Code Here


            errCode >= ExceptionSeverity.SESSION_SEVERITY) {
            //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,
View Full Code Here

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

                // (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")) {
            return new SQLIntegrityConstraintViolationException(msg, sqlstate,
                    code, cause);
        } else if (sqlstate.startsWith("28")) {
            return new SQLInvalidAuthorizationSpecException(msg, sqlstate,
View Full Code Here

    /**
     * @test java.sql.SQLDataException(String, String, int, Throwable)
     */
    public void test_Constructor_LStringLStringILThrowable_12() {
        Throwable cause = new Exception("MYTHROWABLE");
        SQLDataException sQLDataException = new SQLDataException(null,
                "MYTESTSTRING", 1, cause);
        assertNotNull(sQLDataException);
        assertEquals(
                "The SQLState of SQLDataException set and get should be equivalent",
                "MYTESTSTRING", sQLDataException.getSQLState());
        assertNull("The reason of SQLDataException should be null",
                sQLDataException.getMessage());
        assertEquals("The error code of SQLDataException should be 1",
                sQLDataException.getErrorCode(), 1);
        assertEquals(
                "The cause of SQLDataException set and get should be equivalent",
                cause, sQLDataException.getCause());
    }
View Full Code Here

    /**
     * @test java.sql.SQLDataException(String, String, int, Throwable)
     */
    public void test_Constructor_LStringLStringILThrowable_13() {
        SQLDataException sQLDataException = new SQLDataException(null,
                "MYTESTSTRING", 1, null);
        assertNotNull(sQLDataException);
        assertEquals(
                "The SQLState of SQLDataException set and get should be equivalent",
                "MYTESTSTRING", sQLDataException.getSQLState());
        assertNull("The reason of SQLDataException should be null",
                sQLDataException.getMessage());
        assertEquals("The error code of SQLDataException should be 1",
                sQLDataException.getErrorCode(), 1);
        assertNull("The cause of SQLDataException should be null",
                sQLDataException.getCause());
    }
View Full Code Here

    /**
     * @test java.sql.SQLDataException(String, String, int, Throwable)
     */
    public void test_Constructor_LStringLStringILThrowable_14() {
        Throwable cause = new Exception("MYTHROWABLE");
        SQLDataException sQLDataException = new SQLDataException(null,
                "MYTESTSTRING", 0, cause);
        assertNotNull(sQLDataException);
        assertEquals(
                "The SQLState of SQLDataException set and get should be equivalent",
                "MYTESTSTRING", sQLDataException.getSQLState());
        assertNull("The reason of SQLDataException should be null",
                sQLDataException.getMessage());
        assertEquals("The error code of SQLDataException should be 0",
                sQLDataException.getErrorCode(), 0);
        assertEquals(
                "The cause of SQLDataException set and get should be equivalent",
                cause, sQLDataException.getCause());
    }
View Full Code Here

    /**
     * @test java.sql.SQLDataException(String, String, int, Throwable)
     */
    public void test_Constructor_LStringLStringILThrowable_15() {
        SQLDataException sQLDataException = new SQLDataException(null,
                "MYTESTSTRING", 0, null);
        assertNotNull(sQLDataException);
        assertEquals(
                "The SQLState of SQLDataException set and get should be equivalent",
                "MYTESTSTRING", sQLDataException.getSQLState());
        assertNull("The reason of SQLDataException should be null",
                sQLDataException.getMessage());
        assertEquals("The error code of SQLDataException should be 0",
                sQLDataException.getErrorCode(), 0);
        assertNull("The cause of SQLDataException should be null",
                sQLDataException.getCause());

    }
View Full Code Here

    /**
     * @test java.sql.SQLDataException(String, String, int, Throwable)
     */
    public void test_Constructor_LStringLStringILThrowable_16() {
        Throwable cause = new Exception("MYTHROWABLE");
        SQLDataException sQLDataException = new SQLDataException(null,
                "MYTESTSTRING", -1, cause);
        assertNotNull(sQLDataException);
        assertEquals(
                "The SQLState of SQLDataException set and get should be equivalent",
                "MYTESTSTRING", sQLDataException.getSQLState());
        assertNull("The reason of SQLDataException should be null",
                sQLDataException.getMessage());
        assertEquals("The error code of SQLDataException should be -1",
                sQLDataException.getErrorCode(), -1);
        assertEquals(
                "The cause of SQLDataException set and get should be equivalent",
                cause, sQLDataException.getCause());
    }
View Full Code Here

    /**
     * @test java.sql.SQLDataException(String, String, int, Throwable)
     */
    public void test_Constructor_LStringLStringILThrowable_17() {
        SQLDataException sQLDataException = new SQLDataException(null,
                "MYTESTSTRING", -1, null);
        assertNotNull(sQLDataException);
        assertEquals(
                "The SQLState of SQLDataException set and get should be equivalent",
                "MYTESTSTRING", sQLDataException.getSQLState());
        assertNull("The reason of SQLDataException should be null",
                sQLDataException.getMessage());
        assertEquals("The error code of SQLDataException should be -1",
                sQLDataException.getErrorCode(), -1);
        assertNull("The cause of SQLDataException should be null",
                sQLDataException.getCause());
    }
View Full Code Here

TOP

Related Classes of java.sql.SQLDataException

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.