private class PreparedStatementCreatorFactory.PreparedStatementCreatorImpl extends java.lang.Object implements PreparedStatementCreator, PreparedStatementSetter, SqlProvider, ParameterDisposer
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
actualSql |
private java.util.List<?> |
parameters |
Constructor and Description |
---|
PreparedStatementCreatorImpl(java.util.List<?> parameters) |
PreparedStatementCreatorImpl(java.lang.String actualSql,
java.util.List<?> parameters) |
Modifier and Type | Method and Description |
---|---|
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() |
private final java.lang.String actualSql
private final java.util.List<?> parameters
public PreparedStatementCreatorImpl(java.util.List<?> parameters)
public PreparedStatementCreatorImpl(java.lang.String actualSql, java.util.List<?> parameters)
public java.sql.PreparedStatement createPreparedStatement(java.sql.Connection con) throws java.sql.SQLException
PreparedStatementCreator
createPreparedStatement
in interface PreparedStatementCreator
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.public void setValues(java.sql.PreparedStatement ps) throws java.sql.SQLException
PreparedStatementSetter
setValues
in interface PreparedStatementSetter
ps
- the PreparedStatement to invoke setter methods onjava.sql.SQLException
- if a SQLException is encountered
(i.e. there is no need to catch SQLException)public java.lang.String getSql()
SqlProvider
getSql
in interface SqlProvider
null
public void cleanupParameters()
ParameterDisposer
cleanupParameters
in interface ParameterDisposer
DisposableSqlTypeValue.cleanup()
,
SqlLobValue.cleanup()
public java.lang.String toString()
toString
in class java.lang.Object