Package java.sql

Examples of java.sql.SQLTransientConnectionException


                // then, e.g. - the database may spuriously cease to be "in use"
                //              upon retry
                //            - the network configuration, server availability
                //              may change spuriously
                //            - keystore location/content may change spuriously
                return new SQLTransientConnectionException(msg, sqlstate,
                        code, cause);
            } else {

                // the database is (permanently) shut down or the connection is
                // (permanently) closed or broken
View Full Code Here


public class SQLTransientConnectionExceptionTest extends TestCase {

    private SQLTransientConnectionException sQLTransientConnectionException;

    protected void setUp() throws Exception {
        sQLTransientConnectionException = new SQLTransientConnectionException(
                "MYTESTSTRING", "MYTESTSTRING", 1, new Exception("MYTHROWABLE"));
    }
View Full Code Here

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

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

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

    }
View Full Code Here

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

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

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

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

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

TOP

Related Classes of java.sql.SQLTransientConnectionException

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.