JDBC Driver - Relational Results

On this page

The RelationalResult object in the Polypheny JDBC Multimodel Extension serves to encapsulate the result of a query in a relational model. Similar to DocumentResult, it provides an iterator to loop through the individual rows of the query result, represented as PolyRow objects.

iterator

public Iterator<PolyRow> iterator()

Returns a Java-compliant iterator that iterates over PolyRow objects contained in the RelationalResult.

Return Type:

  • Returns an iterator over PolyRow objects.

Usage:

Iterator<PolyRow> rowIterator = relationalResult.iterator();
while (rowIterator.hasNext()) {
    PolyRow polyRow = rowIterator.next();
    // Process each PolyRow object...
}

To iterate over the rows and print each one:

Iterator<PolyRow> rowIterator = relationalResult.iterator();
while (rowIterator.hasNext()) {
    PolyRow polyRow = rowIterator.next();
    System.out.println(polyRow.toString());
}
© Polypheny GmbH. All Rights Reserved.