JDBC Driver - Relational Rows

org.polypheny.jdbc.multimodel.PolyRow holds the values of one row in a RelationalResult. Each column is an org.polypheny.jdbc.types.TypedValue.

getColumnCount

getColumnCount() returns the number of values in the row.

getValue

getValue(int columnIndex) and get(int columnIndex) return a TypedValue at a zero-based index. The first column is at index 0. An index outside the row throws IndexOutOfBoundsException.

Use isNull() to test for a null value before reading it with primitive conversions such as asInt(). Typed values also provide asString(), asObject(), and conversions for the JDBC types. See the TypedValue reference.

Read by alias

On rows returned from a query, get(String columnLabel) looks up the exact column label. For RETURN n AS person, n.name AS name, call row.get("person").asNode() to read the node and row.get("name").asString() to read the name. When several columns have the same label, the method returns the first one.

Construction

PolyRow(List<TypedValue>) and PolyRow(TypedValue...) copy the supplied values into a row in their original order. PolyRow.of(TypedValue...) is a factory for the varargs constructor. PolyRow.fromProto(Row) converts a row from the driver’s bundled Prism API into the same representation. These methods are useful for handling values in memory. Queries return rows through RelationalResult.

© Polypheny GmbH. All Rights Reserved.