public interface PreparedStatementCreator
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.
Modifier and Type | Method and Description |
---|---|
java.sql.PreparedStatement |
createPreparedStatement(java.sql.Connection con)
Create a statement in this connection.
|
java.sql.PreparedStatement createPreparedStatement(java.sql.Connection con) throws java.sql.SQLException
con
- Connection to use to create statementjava.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.