Was this page helpful?
ScyllaDB Java Driver is available under the Apache v2 License. ScyllaDB Java Driver is a fork of DataStax Java Driver. See Copyright here.
Caution
You're viewing documentation for a previous version of Scylla Java Driver. Switch to the latest stable version.
To execute a query, you create a Statement instance and pass it to Session#execute() or Session#executeAsync. The driver provides various implementations:
SimpleStatement: a simple implementation built directly from a character string. Typically used for queries that are executed only once or a few times.
BoundStatement: obtained by binding values to a prepared statement. Typically used for queries that are executed often, with different values.
BuiltStatement: a statement built with the QueryBuilder DSL. It can be executed directly like a simple statement, or prepared.
BatchStatement: a statement that groups multiple statements to be executed as a batch.
Before executing a statement, you might want to customize certain
aspects of its execution. Statement
provides a number of methods for
this, for example:
Statement s = new SimpleStatement("select release_version from system.local");
s.enableTracing();
session.execute(s);
If you use custom policies (RetryPolicy, LoadBalancingPolicy, SpeculativeExecutionPolicy…), you might also want to have custom properties that influence statement execution. To achieve this, you can wrap your statements in a custom StatementWrapper implementation.
Was this page helpful?
ScyllaDB Java Driver is available under the Apache v2 License. ScyllaDB Java Driver is a fork of DataStax Java Driver. See Copyright here.
On this page