Explain about PreparedStatementCreator?

Explain about PreparedStatementCreator?

The PreparedStatementCreator interface is a 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. 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. 
It has one method:
PreparedStatement createPreparedStatement(Connection con) throws SQLException

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

Date:2002-02-09 00:00:00

Post Your Answers

User Email:

User Name:

Related Java Subjective Links

Java Subjective interview questions and answers for experienced and fresher