Code example for SQLSyntaxErrorException

Methods: getCause, getErrorCode, getMessage, getSQLState

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