Package java.sql

Examples of java.sql.SQLRecoverableException


    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()));
    assertFalse(this.dialect.indicatesFailure(new SQLTransactionRollbackException()));
    assertFalse(this.dialect.indicatesFailure(new SQLWarning()));
    assertFalse(this.dialect.indicatesFailure(new DataTruncation(1, false, false, 1, 1)));
View Full Code Here


        switch (h) {
        case ResultSet.CLOSE_CURSORS_AT_COMMIT:
        case ResultSet.HOLD_CURSORS_OVER_COMMIT:
            return;
        default:
            throw new SQLRecoverableException(String.format("%d is not a valid holdability setting", h));
        }
    }
View Full Code Here

    /**
     * @test java.sql.SQLRecoverableException(String, String)
     */
    public void test_Constructor_LStringLString() {
        SQLRecoverableException sQLRecoverableException = new SQLRecoverableException(
                "MYTESTSTRING1", "MYTESTSTRING2");
        assertNotNull(sQLRecoverableException);
        assertEquals(
                "The SQLState of SQLRecoverableException set and get should be equivalent",
                "MYTESTSTRING2", sQLRecoverableException.getSQLState());
        assertEquals(
                "The reason of SQLRecoverableException set and get should be equivalent",
                "MYTESTSTRING1", sQLRecoverableException.getMessage());
        assertEquals("The error code of SQLRecoverableException should be 0",
                sQLRecoverableException.getErrorCode(), 0);

    }
View Full Code Here

    /**
     * @test java.sql.SQLRecoverableException(String, String)
     */
    public void test_Constructor_LStringLString_1() {
        SQLRecoverableException sQLRecoverableException = new SQLRecoverableException(
                "MYTESTSTRING", (String) null);
        assertNotNull(sQLRecoverableException);
        assertNull("The SQLState of SQLRecoverableException should be null",
                sQLRecoverableException.getSQLState());
        assertEquals(
                "The reason of SQLRecoverableException set and get should be equivalent",
                "MYTESTSTRING", sQLRecoverableException.getMessage());
        assertEquals("The error code of SQLRecoverableException should be 0",
                sQLRecoverableException.getErrorCode(), 0);
    }
View Full Code Here

    /**
     * @test java.sql.SQLRecoverableException(String, String)
     */
    public void test_Constructor_LStringLString_2() {
        SQLRecoverableException sQLRecoverableException = new SQLRecoverableException(
                null, "MYTESTSTRING");
        assertNotNull(sQLRecoverableException);
        assertEquals(
                "The SQLState of SQLRecoverableException set and get should be equivalent",
                "MYTESTSTRING", sQLRecoverableException.getSQLState());
        assertNull("The reason of SQLRecoverableException should be null",
                sQLRecoverableException.getMessage());
        assertEquals("The error code of SQLRecoverableException should be 0",
                sQLRecoverableException.getErrorCode(), 0);
    }
View Full Code Here

    /**
     * @test java.sql.SQLRecoverableException(String, String)
     */
    public void test_Constructor_LStringLString_3() {
        SQLRecoverableException sQLRecoverableException = new SQLRecoverableException(
                (String) null, (String) null);
        assertNotNull(sQLRecoverableException);
        assertNull("The SQLState of SQLRecoverableException should be null",
                sQLRecoverableException.getSQLState());
        assertNull("The reason of SQLRecoverableException should be null",
                sQLRecoverableException.getMessage());
        assertEquals("The error code of SQLRecoverableException should be 0",
                sQLRecoverableException.getErrorCode(), 0);
    }
View Full Code Here

    /**
     * @test java.sql.SQLRecoverableException(String, String, int)
     */
    public void test_Constructor_LStringLStringI() {
        SQLRecoverableException sQLRecoverableException = new SQLRecoverableException(
                "MYTESTSTRING1", "MYTESTSTRING2", 1);
        assertNotNull(sQLRecoverableException);
        assertEquals(
                "The SQLState of SQLRecoverableException set and get should be equivalent",
                "MYTESTSTRING2", sQLRecoverableException.getSQLState());
        assertEquals(
                "The reason of SQLRecoverableException set and get should be equivalent",
                "MYTESTSTRING1", sQLRecoverableException.getMessage());
        assertEquals("The error code of SQLRecoverableException should be 1",
                sQLRecoverableException.getErrorCode(), 1);
    }
View Full Code Here

    /**
     * @test java.sql.SQLRecoverableException(String, String, int)
     */
    public void test_Constructor_LStringLStringI_1() {
        SQLRecoverableException sQLRecoverableException = new SQLRecoverableException(
                "MYTESTSTRING1", "MYTESTSTRING2", 0);
        assertNotNull(sQLRecoverableException);
        assertEquals(
                "The SQLState of SQLRecoverableException set and get should be equivalent",
                "MYTESTSTRING2", sQLRecoverableException.getSQLState());
        assertEquals(
                "The reason of SQLRecoverableException set and get should be equivalent",
                "MYTESTSTRING1", sQLRecoverableException.getMessage());
        assertEquals("The error code of SQLRecoverableException should be 0",
                sQLRecoverableException.getErrorCode(), 0);
    }
View Full Code Here

    /**
     * @test java.sql.SQLRecoverableException(String, String, int)
     */
    public void test_Constructor_LStringLStringI_2() {
        SQLRecoverableException sQLRecoverableException = new SQLRecoverableException(
                "MYTESTSTRING1", "MYTESTSTRING2", -1);
        assertNotNull(sQLRecoverableException);
        assertEquals(
                "The SQLState of SQLRecoverableException set and get should be equivalent",
                "MYTESTSTRING2", sQLRecoverableException.getSQLState());
        assertEquals(
                "The reason of SQLRecoverableException set and get should be equivalent",
                "MYTESTSTRING1", sQLRecoverableException.getMessage());
        assertEquals("The error code of SQLRecoverableException should be -1",
                sQLRecoverableException.getErrorCode(), -1);
    }
View Full Code Here

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

TOP

Related Classes of java.sql.SQLRecoverableException

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.