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.
JdbcTemplate#execute(PreparedStatementCreator, PreparedStatementCallback), JdbcTemplate#query(PreparedStatementCreator, RowCallbackHandler), JdbcTemplate#update(PreparedStatementCreator), SqlProvider
| Modifier and Type | Method and Description |
|---|---|
| public PreparedStatement | Returns: a prepared statementthe connection used to create statement con)Create a statement in this connection. |
| createPreparedStatement | back to summary |
|---|---|
| public PreparedStatement createPreparedStatement(Connection con) throws SQLException Create a statement in this connection. Allows implementations to use PreparedStatements. The JdbcTemplate will close the created statement.
| |