org.springframework.jdbc.core
Class JdbcTemplate.SimplePreparedStatementCreator

java.lang.Object
  extended byorg.springframework.jdbc.core.JdbcTemplate.SimplePreparedStatementCreator
All Implemented Interfaces:
PreparedStatementCreator, SqlProvider
Enclosing class:
JdbcTemplate

protected static final class JdbcTemplate.SimplePreparedStatementCreator
extends java.lang.Object
implements PreparedStatementCreator, SqlProvider

Simple adapter for PreparedStatementCreator, allowing to use a plain SQL statement.


Constructor Summary
JdbcTemplate.SimplePreparedStatementCreator(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, typically the SQL used for creating statements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JdbcTemplate.SimplePreparedStatementCreator

public JdbcTemplate.SimplePreparedStatementCreator(java.lang.String sql)
Method Detail

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, typically the SQL used for creating statements.

Specified by:
getSql in interface SqlProvider
Returns:
the SQL string, or null


Copyright (C) 2003-2004 The Spring Framework Project.