org.springframework.jdbc.core
Class PreparedStatementCreatorFactory.PreparedStatementCreatorImpl

java.lang.Object
  extended by org.springframework.jdbc.core.PreparedStatementCreatorFactory.PreparedStatementCreatorImpl
All Implemented Interfaces:
ParameterDisposer, PreparedStatementCreator, PreparedStatementSetter, SqlProvider
Enclosing class:
PreparedStatementCreatorFactory

private class PreparedStatementCreatorFactory.PreparedStatementCreatorImpl
extends java.lang.Object
implements PreparedStatementCreator, PreparedStatementSetter, SqlProvider, ParameterDisposer

PreparedStatementCreator implementation returned by this class.


Field Summary
private  java.lang.String actualSql
           
private  java.util.List parameters
           
 
Constructor Summary
PreparedStatementCreatorFactory.PreparedStatementCreatorImpl(java.util.List<?> parameters)
           
PreparedStatementCreatorFactory.PreparedStatementCreatorImpl(java.lang.String actualSql, java.util.List parameters)
           
 
Method Summary
 void cleanupParameters()
          Close the resources allocated by parameters that the implementing object holds, for example in case of a DisposableSqlTypeValue (like a SqlLobValue).
 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.
 void setValues(java.sql.PreparedStatement ps)
          Set parameter values on the given PreparedStatement.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

actualSql

private final java.lang.String actualSql

parameters

private final java.util.List parameters
Constructor Detail

PreparedStatementCreatorFactory.PreparedStatementCreatorImpl

public PreparedStatementCreatorFactory.PreparedStatementCreatorImpl(java.util.List<?> parameters)

PreparedStatementCreatorFactory.PreparedStatementCreatorImpl

public PreparedStatementCreatorFactory.PreparedStatementCreatorImpl(java.lang.String actualSql,
                                                                    java.util.List parameters)
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.

setValues

public void setValues(java.sql.PreparedStatement ps)
               throws java.sql.SQLException
Description copied from interface: PreparedStatementSetter
Set parameter values on the given PreparedStatement.

Specified by:
setValues in interface PreparedStatementSetter
Parameters:
ps - the PreparedStatement to invoke setter methods on
Throws:
java.sql.SQLException - if a SQLException is encountered (i.e. there is no need to catch SQLException)

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

cleanupParameters

public void cleanupParameters()
Description copied from interface: ParameterDisposer
Close the resources allocated by parameters that the implementing object holds, for example in case of a DisposableSqlTypeValue (like a SqlLobValue).

Specified by:
cleanupParameters in interface ParameterDisposer
See Also:
DisposableSqlTypeValue.cleanup(), SqlLobValue.cleanup()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object