Overview | Package | Class | Tree | Deprecated | Index | Help
| Spring Framework
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.springframework.jdbc.core
Interface PreparedStatementCreator

    public interface PreparedStatementCreator

One of the two central callback interfaces used by the JdbcTemplate class. This interface creates a PreparedStatement 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
See Also:
  `JdbcTemplate.execute(PreparedStatementCreator, PreparedStatementCallback)`, `JdbcTemplate.query(PreparedStatementCreator, RowCallbackHandler)`, `JdbcTemplate.update(PreparedStatementCreator)`, `SqlProvider`

Method Summary
`java.sql.PreparedStatement` | `createPreparedStatement(java.sql.Connection con)` Create a statement in this connection.

Method Detail

### createPreparedStatement

    java.sql.PreparedStatement createPreparedStatement(java.sql.Connection con)
                                                       throws java.sql.SQLException

  Create a statement in this connection. Allows implementations to use PreparedStatements. The JdbcTemplate will close the created statement.

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

Overview | Package | Class | Tree | Deprecated | Index | Help
| Spring Framework
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD