try {
Collection col = (Collection) query.executeWithArray(param);
Iterator iter = col.iterator();
if (!iter.hasNext())
throw new RuntimeException("Query on employee does not return any row");
Employee e = (Employee) iter.next();
outStr.append("\n\tEmployee name (").append(e.getEmpid());
outStr.append("): ").append(e.getFirstname()).append(" ");
outStr.append(e.getLastname());
if (false && e.getEmpid() != idMax) {
throw new RuntimeException("Query on employee returns an other first row than expecting");
}
while (iter.hasNext()) {
e = (Employee) iter.next();
outStr.append("\n\tEmployee name (").append(e.getEmpid());
outStr.append("): ").append(e.getFirstname()).append(" ");
outStr.append(e.getLastname());
}
if (false && e.getEmpid() != idMin)
throw new RuntimeException("Query on employee returns an other last row than expecting");
} finally {
query.closeAll();
}
}