Interface PreparedStatementBinder
- All Known Subinterfaces:
AsyncCassandraTemplate.AsyncPreparedStatementHandler,AsyncCassandraTemplate.AsyncPreparedStatementHandler,ReactiveCassandraTemplate.ReactivePreparedStatementHandler
- All Known Implementing Classes:
ArgumentPreparedStatementBinder,AsyncCassandraTemplate.PreparedStatementHandler,CassandraTemplate.PreparedStatementHandler,ReactiveCassandraTemplate.PreparedStatementHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
General callback interface used by the
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 DriverExceptions that may be thrown from
operations they attempt. The CqlTemplate class will catch and handle DriverException appropriately.
-
Method Summary
Modifier and TypeMethodDescriptioncom.datastax.oss.driver.api.core.cql.BoundStatementbindValues(com.datastax.oss.driver.api.core.cql.PreparedStatement ps) Bind parameter values on the givenPreparedStatement.
-
Method Details
-
bindValues
com.datastax.oss.driver.api.core.cql.BoundStatement bindValues(com.datastax.oss.driver.api.core.cql.PreparedStatement ps) throws com.datastax.oss.driver.api.core.DriverException Bind parameter values on the givenPreparedStatement.- Parameters:
ps- the PreparedStatement to invoke setter methods on.- Throws:
com.datastax.oss.driver.api.core.DriverException- if aDriverExceptionis encountered (i.e. there is no need to catchDriverException)
-