DbUnitTask task = (DbUnitTask)target.getTasks()[0];
DbUnitTask task = null;  Object[] tasks = target.getTasks(); for(int i = 0; i < tasks.length; i++) { if(tasks[i] instanceof DbUnitTask) { task = (DbUnitTask)tasks[i]; } }
    private DbUnitTask getFirstTargetTask(String targetName)    {        Hashtable targets = project.getTargets();        executeTarget(targetName);        Target target = (Target)targets.get(targetName);        DbUnitTask task = (DbUnitTask)target.getTasks()[0];        return task;    }