站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 2.0.5 API 文档英文版

CallableStatementCreator (Spring Framework API 2.0) - Spring Framework 2.0.5 API 文档英文版

The Spring Framework

org.springframework.jdbc.core
Interface CallableStatementCreator


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.

Author:
Rod Johnson, Thomas Risberg
See Also:
JdbcTemplate.execute(CallableStatementCreator, CallableStatementCallback), JdbcTemplate.call(org.springframework.jdbc.core.CallableStatementCreator, java.util.List), SqlProvider

Method Summary
 CallableStatement createCallableStatement(Connection con)
          Create a callable statement in this connection.
 

Method Detail

createCallableStatement

CallableStatement createCallableStatement(Connection con)
                                          throws SQLException
Create a callable statement in this connection. Allows implementations to use CallableStatements.

Parameters:
con - Connection to use to create statement
Returns:
a callable statement
Throws:
SQLException - there is no need to catch SQLExceptions that may be thrown in the implementation of this method. The JdbcTemplate class will handle them.

The Spring Framework

Copyright © 2002-2007 The Spring Framework.