JDBC Driver - Document Results

On this page

org.polypheny.jdbc.multimodel.DocumentResult is a Result of type DOCUMENT. It implements Iterable<PolyDocument>. Get it by unwrapping a result that contains a Prism document frame. Each PolyDocument holds the fields of one returned document.

iterator

iterator() returns a Java Iterator<PolyDocument>. A for-each loop reads documents in result order. Iteration fetches additional frames synchronously as needed and keeps fetched documents in memory. A fetch failure propagates as a RuntimeException whose cause is the PrismInterfaceServiceException. Calling next() on an exhausted iterator throws NoSuchElementException.

Keep the originating PolyStatement and its connection available until iteration is complete. The driver builds the result using DocumentResult(Frame, PolyStatement). Applications normally obtain it through execute.

See the runnable MongoQL example for queries and writes. For metadata describing the collection, see document collection metadata.

© Polypheny GmbH. All Rights Reserved.