Java 8 SQLTransientConnectionException - 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 SQLTransientConnectionException class.

This code example shows how to use the following methods:
	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); 
	} 
 
} 
6
CodeRank
This code example shows how to use the following methods:getCause, getMessage, getErrorCode, getSQLState
    /** 
     * @test java.sql.SQLTransientConnectionException(String, Throwable) 
     */ 
    public void test_Constructor_LStringLThrowable() { 
        Throwable cause = new Exception("MYTHROWABLE");
        SQLTransientConnectionException sQLTransientConnectionException = new SQLTransientConnectionException(
                "MYTESTSTRING", cause);
        assertNotNull(sQLTransientConnectionException);
        assertEquals(
                "The reason of SQLTransientConnectionException set and get should be equivalent", 
                "MYTESTSTRING", sQLTransientConnectionException.getMessage());
        assertNull(
                "The SQLState of SQLTransientConnectionException should be null", 
                sQLTransientConnectionException.getSQLState());
        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());

5
CodeRank
This code example shows how to use the following methods:
                // 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 
                return new SQLNonTransientConnectionException(msg, sqlstate,
                        code, cause);
            } 
        } else if (sqlstate.startsWith("22")) {
            return new SQLDataException(msg, sqlstate, code, cause);
        } else if (sqlstate.startsWith("23")) {
            return new SQLIntegrityConstraintViolationException(msg, sqlstate,
                    code, cause);
        } else if (sqlstate.startsWith("28")) {
4
CodeRank
See Code Examples for Java 8 SQLTransientConnectionException Methods: