Package java.sql

Examples of java.sql.SQLTransactionRollbackException


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

    }
View Full Code Here


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

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

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

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

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

  public static SQLException newSQLSyntaxErrorException(String reason, String SQLState, int vendorCode) {
    return new SQLSyntaxErrorException(reason, SQLState, vendorCode);
  }

  public static SQLException newSQLTransactionRollbackException(String reason, String SQLState, int vendorCode) {
    return new SQLTransactionRollbackException(reason, SQLState, vendorCode);
  }
View Full Code Here

            // 40001  transaction rollback  - (transaction) serialization failure
            // 40002  transaction rollback  - integrity constraint violation
            // 40003  transaction rollback  - statement completion unknown
            // 40004  transaction rollback  - triggered action exception
            //
            return new SQLTransactionRollbackException(msg, sqlstate, code,
                    cause);
        } else if (sqlstate.startsWith("0A")) {    // JSR 221 2005-12-14 prd
            return new SQLFeatureNotSupportedException(msg, sqlstate, code,
                    cause);
        } else {
View Full Code Here

TOP

Related Classes of java.sql.SQLTransactionRollbackException

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.