@FunctionalInterface public interface PreparedStatementBinder
CqlTemplate
and ReactiveCqlTemplate
classes.
This interface binds values on a PreparedStatement
provided by the CqlTemplate
class, for each of a
number of updates in a batch using the same CQL. Implementations are responsible for setting any necessary
parameters. CQL with placeholders will already have been supplied.
It's easier to use this interface than PreparedStatementCreator
: The CqlTemplate
will create the
PreparedStatement
, with the callback only being responsible for setting parameter values.
Implementations do not need to concern themselves with DriverException
s that may be thrown from
operations they attempt. The CqlTemplate
class will catch and handle DriverException
appropriately.
CqlTemplate.query(String, PreparedStatementBinder, ResultSetExtractor)
,
AsyncCqlTemplate.query(AsyncPreparedStatementCreator, PreparedStatementBinder, ResultSetExtractor)
,
ReactiveCqlTemplate.query(String, PreparedStatementBinder, ReactiveResultSetExtractor)
Modifier and Type | Method and Description |
---|---|
com.datastax.driver.core.BoundStatement |
bindValues(com.datastax.driver.core.PreparedStatement ps)
Bind parameter values on the given
PreparedStatement . |
com.datastax.driver.core.BoundStatement bindValues(com.datastax.driver.core.PreparedStatement ps) throws com.datastax.driver.core.exceptions.DriverException
PreparedStatement
.ps
- the PreparedStatement to invoke setter methods on.com.datastax.driver.core.exceptions.DriverException
- if a DriverException
is encountered (i.e. there is no need to catch
DriverException
)Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.