javadocumentumdfcdocumentum-dfc

IDFCollection to java.util.Collection or ArrayList


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


Solution

  • 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.