Class Statement (6.119.0)
Stay organized with collections
Save and categorize content based on your preferences.
publicfinalclassStatementimplementsSerializable
A SQL statement and optional bound parameters that can be executed in a ReadContext.
The SQL query string can contain parameter placeholders. A parameter placeholder consists of
@ followed by the parameter name. Parameter names consist of any combination of
letters, numbers, and underscores.
Parameters can appear anywhere that a literal value is expected. The same parameter name can
be used more than once, for example: WHERE id > @msg_id AND id < @msg_id + 100
It is an error to execute an SQL query with placeholders for unbound parameters.
Statements are constructed using a builder. Parameter values are specified by calling Builder#bind(String). For example, code to build a query using the clause above and bind a value
to id might look like the following:
Statementstatement=Statement.newBuilder("SELECT name WHERE id > @msg_id AND id < @msg_id="" +="" 100")="".bind("msg_id").to(500)="".build();="">