IDFCollection to java.util.Collection or ArrayList

1.4k views Asked by At

How can I retrieve and store the values from IDFCollection to java.util.Collection or ArrayList. Is there any direct way to do it?

1

There are 1 answers

0
Sergi On BEST ANSWER

You can iterate IDfCollection using IDfCollection.next() method. If next() returns true, then you can access returned row of data by using getter methods of IDfCollection. When you call next() again, it will move to the next row (if any). Usually reading from collection is done in while loop:

while(col.next())
{
  String value1 = col.getString("column1");
}

To store values to a list - just create an instance before while and fill it inside the loop.