org.springframework.jdbc.core
Class JdbcTemplate.SimplePreparedStatementCreator
java.lang.Object
org.springframework.jdbc.core.JdbcTemplate.SimplePreparedStatementCreator
- All Implemented Interfaces:
- PreparedStatementCreator, SqlProvider
- Enclosing class:
- JdbcTemplate
private static class JdbcTemplate.SimplePreparedStatementCreator
- extends java.lang.Object
- implements PreparedStatementCreator, SqlProvider
Simple adapter for PreparedStatementCreator, allowing to use a plain SQL statement.
Field Summary |
private java.lang.String |
sql
|
Method Summary |
java.sql.PreparedStatement |
createPreparedStatement(java.sql.Connection con)
Create a statement in this connection. |
java.lang.String |
getSql()
Return the SQL string for this object, i.e. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
sql
private final java.lang.String sql
JdbcTemplate.SimplePreparedStatementCreator
public JdbcTemplate.SimplePreparedStatementCreator(java.lang.String sql)
createPreparedStatement
public java.sql.PreparedStatement createPreparedStatement(java.sql.Connection con)
throws java.sql.SQLException
- Description copied from interface:
PreparedStatementCreator
- Create a statement in this connection. Allows implementations to use
PreparedStatements. The JdbcTemplate will close the created statement.
- Specified by:
createPreparedStatement
in interface PreparedStatementCreator
- 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.
getSql
public java.lang.String getSql()
- Description copied from interface:
SqlProvider
- Return the SQL string for this object, i.e.
typically the SQL used for creating statements.
- Specified by:
getSql
in interface SqlProvider
- Returns:
- the SQL string, or
null