JDBC Driver - Scalar Results

On this page

The ScalarResult object in the Polypheny JDBC Multimodel Extension serves to encapsulate the result of a query returning a single scalar value such as a single number. Such results occur on updates or inserts when the number of altered entries are returned.

getScalar

public long getScalar()

Returns the returned scalar as a long.

Return Type:

  • Returns the scalar as a long.

Usage:

Result result = polyConnection.execute("public", "mql", "db.users.insertOne({ name: "Jane Doe", age: 30 })");
ScalarResult scalarResult = result.unwrap(ScalarResult.class);
long entriesChanged = scalarResult.getScalar();
© Polypheny GmbH. All Rights Reserved.