Stepping Forward Through a Query Result Set

Step through a view object instance's result set by calling the view object's next() method. This method increments the view object instance's current row pointer and then returns the new current row.

Before calling next(), you should call hasNext() to make sure the view object instance's pointer is not on its last row.

The following example uses next() to step through the view object instance mgrVO and sum the salaries of all of the managers:

Row currRow;
int sumSal = 0;
while (mgrVO.hasNext())
{
  currRow = mgrVO.next();
  sumSal += currRow.getAttribute("Salary").intValue();
}        

Ways to Navigate Through Query Results
About Oracle ADF View Objects
Finding View Object Instances in the Data Model
Retrieving Attribute Values

 

 

 

Copyright © 1997, 2004, Oracle. All rights reserved.