Code example for SQLSyntaxErrorException

Methods: getCause, getErrorCode, getMessage, getSQLState

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