Package java.sql

Examples of java.sql.SQLTimeoutException


            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))) {
            ex = new SQLTimeoutException(message, sqlState, errCode);
        } else {
            ex = new SQLException(message, sqlState, errCode);
        }
        return ex;
    }
View Full Code Here


        } else if (sqlState.startsWith(SQLState.LSE_COMPILATION_PREFIX)) {
            ex = new SQLSyntaxErrorException(message, sqlState, severity, t);
        } else if (sqlState.startsWith(SQLState.UNSUPPORTED_PREFIX)) {
            ex = new SQLFeatureNotSupportedException(message, sqlState, severity, t);
        } else if (sqlState.equals(SQLState.LANG_STATEMENT_CANCELLED_OR_TIMED_OUT.substring(0, 5))) {
            ex = new SQLTimeoutException(message, sqlState, severity, t);
        } else {
            ex = new SQLException(message, sqlState, severity, t);
        }
       
        if (next != null) {
View Full Code Here

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

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

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

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

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

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

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

    /**
     * @test java.sql.SQLTimeoutException(String, String, int, Throwable)
     */
    public void test_Constructor_LStringLStringILThrowable_5() {
        SQLTimeoutException sQLTimeoutException = new SQLTimeoutException(
                "MYTESTSTRING1", "MYTESTSTRING2", -1, null);
        assertNotNull(sQLTimeoutException);
        assertEquals(
                "The SQLState of SQLTimeoutException set and get should be equivalent",
                "MYTESTSTRING2", sQLTimeoutException.getSQLState());
        assertEquals(
                "The reason of SQLTimeoutException set and get should be equivalent",
                "MYTESTSTRING1", sQLTimeoutException.getMessage());
        assertEquals("The error code of SQLTimeoutException should be -1",
                sQLTimeoutException.getErrorCode(), -1);
        assertNull("The cause of SQLTimeoutException should be null",
                sQLTimeoutException.getCause());

    }
View Full Code Here

TOP

Related Classes of java.sql.SQLTimeoutException

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.