@FunctionalInterface public interface PreparedStatementCreator
CqlTemplate
class. This interface creates a
PreparedStatement
given a session, provided by the CqlTemplate
class. Implementations are responsible
for providing CQL and any necessary parameters.
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
s appropriately.
Classes implementing this interface should also implement the CqlProvider
interface if it is able to provide
the CQL it uses for PreparedStatement
creation. This allows for better contextual information in case of
exceptions.
CqlTemplate.execute(PreparedStatementCreator, PreparedStatementCallback)
,
CqlTemplate.query(PreparedStatementCreator, RowCallbackHandler)
,
CqlProvider
Modifier and Type | Method and Description |
---|---|
com.datastax.oss.driver.api.core.cql.PreparedStatement |
createPreparedStatement(com.datastax.oss.driver.api.core.CqlSession session)
Create a statement in this session.
|
com.datastax.oss.driver.api.core.cql.PreparedStatement createPreparedStatement(com.datastax.oss.driver.api.core.CqlSession session) throws com.datastax.oss.driver.api.core.DriverException
PreparedStatement
.session
- CqlSession
to use to create statement.com.datastax.oss.driver.api.core.DriverException
- there is no need to catch DriverException
that may be thrown in the implementation
of this method. The CqlTemplate
class will handle them.Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.