Code example for SQLDataException

Methods: getCause, getErrorCode, getMessage, getSQLState

0
 
    /** 
     * @test java.sql.SQLDataException(String, Throwable) 
     */ 
    public void test_Constructor_LStringLThrowable_3() { 
        SQLDataException sQLDataException = new SQLDataException((String) null,
                (Throwable) null);
        assertNotNull(sQLDataException);
        assertNull("The SQLState of SQLDataException should be null",
                sQLDataException.getSQLState());
        assertNull("The reason of SQLDataException should be null",
                sQLDataException.getMessage());
        assertEquals("The error code of SQLDataException should be 0",
                sQLDataException.getErrorCode(), 0);
        assertNull("The cause of SQLDataException should be null",
                sQLDataException.getCause());
    } 
 
    /** 
     * @test java.sql.SQLDataException(String, String, Throwable) 
     */