接口 CallableStatementCreator
- 函数接口:
- 这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。
@FunctionalInterface public interface CallableStatementCreator
One of the three central callback interfaces used by the JdbcTemplate class. This interface creates a CallableStatement given a connection, provided by the JdbcTemplate class. Implementations are responsible for providing SQL and any necessary parameters.Implementations do not need to concern themselves with SQLExceptions that may be thrown from operations they attempt. The JdbcTemplate class will catch and handle SQLExceptions appropriately.
A PreparedStatementCreator should also implement the SqlProvider interface if it is able to provide the SQL it uses for PreparedStatement creation. This allows for better contextual information in case of exceptions.
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 CallableStatement
createCallableStatement(Connection con)
Create a callable statement in this connection.
方法详细资料
createCallableStatement
CallableStatement createCallableStatement(Connection con) throws SQLException
Create a callable statement in this connection. Allows implementations to use CallableStatements.- 参数:
con
- the Connection to use to create statement- 返回:
- a callable statement
- 抛出:
SQLException
- there is no need to catch SQLExceptions that may be thrown in the implementation of this method. The JdbcTemplate class will handle them.