Java 8 SQLTransactionRollbackException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 SQLTransactionRollbackException class.

This code example shows how to use the following methods:
	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); 
	} 
 
	public static SQLException newSQLTransientConnectionException(String reason, String SQLState, int vendorCode) { 
		return new SQLTransientConnectionException(reason, SQLState, vendorCode); 
	} 
 
	public static SQLException newSQLTimeoutException(String reason, String SQLState, int vendorCode) { 
		return new SQLTimeoutException(reason, SQLState, vendorCode); 
	} 
 
	public static SQLException newSQLRecoverableException(String reason, String SQLState, int vendorCode) { 
		return new SQLRecoverableException(reason, SQLState, vendorCode); 
	} 
 
Full Snippet Info
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods: getCause, getMessage, getErrorCode, getSQLState
    /** 
     * @test java.sql.SQLTransactionRollbackException(Throwable) 
     */ 
    public void test_Constructor_LThrowable() { 
        Throwable cause = new Exception("MYTHROWABLE");
        SQLTransactionRollbackException sQLTransactionRollbackException = new SQLTransactionRollbackException(
                cause);
        assertNotNull(sQLTransactionRollbackException);
        assertEquals(
                "The reason of SQLTransactionRollbackException should be equals to cause.toString()", 
                "java.lang.Exception: MYTHROWABLE", 
                sQLTransactionRollbackException.getMessage());
        assertNull(
                "The SQLState of SQLTransactionRollbackException should be null", 
                sQLTransactionRollbackException.getSQLState());
        assertEquals(
                "The error code of SQLTransactionRollbackException should be 0", 
                sQLTransactionRollbackException.getErrorCode(), 0);
        assertEquals(
                "The cause of SQLTransactionRollbackException set and get should be equivalent", 

5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
            // 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 { 
 
            // TODO resolved: 
            // 
            // JSR 221 2005-12-14 prd 
            // 
            //   "Any SQLState class values which are currently not mapped to 
            //    either a SQLNonTransientException or a SQLTransientException 
            //    will result in a java.sql.SQLException being thrown." 
            // 
Full Snippet Info
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Java 8 SQLTransactionRollbackException Methods: