I'm getting result as below after making query to database
VendorName | IncidentID | IncidentStatus | IncidentDate
-------------------------------------------------------
XYZ | 100 | Open | 02-JUN-2011
ABC | 101 | Closed | 03-JUN-2011
MNP | 102 | Open | 01-JUN-2011
LPQ | 103 | Open | 01-APR-2011
I'm iterating the list using following snippet of code
Iterator iter=resultList.iterator();
while (iter.hasNext()) {
Object[] result= (Object[]) iter.next();
System.out.println("Vendor Name-->" +result[0]);
}
While iterating the list, I want to return only the Closed incident row. How to do this ?
I understand, it can be done by defining a new list and add one by one object to this but is there any better approach?