org.springframework.batch.core.resource
Class ListPreparedStatementSetter

java.lang.Object
  extended by org.springframework.batch.core.resource.ListPreparedStatementSetter
All Implemented Interfaces:
InitializingBean, PreparedStatementSetter

public class ListPreparedStatementSetter
extends Object
implements PreparedStatementSetter, InitializingBean

Implementation of the PreparedStatementSetter interface that accepts a list of values to be set on a PreparedStatement. This is usually used in conjunction with the JdbcCursorItemReader to allow for the replacement of bind variables when generating the cursor. The order of the list will be used to determine the ordering of setting variables. For example, the first item in the list will be the first bind variable set. (i.e. it will correspond to the first '?' in the SQL statement)

Author:
Lucas Ward

Constructor Summary
ListPreparedStatementSetter()
           
 
Method Summary
 void afterPropertiesSet()
           
 void setParameters(List<?> parameters)
          The parameter values that will be set on the PreparedStatement.
 void setValues(PreparedStatement ps)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListPreparedStatementSetter

public ListPreparedStatementSetter()
Method Detail

setValues

public void setValues(PreparedStatement ps)
               throws SQLException
Specified by:
setValues in interface PreparedStatementSetter
Throws:
SQLException

setParameters

public void setParameters(List<?> parameters)
The parameter values that will be set on the PreparedStatement. It is assumed that their order in the List is the order of the parameters in the PreparedStatement.


afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception


Copyright © 2009 SpringSource. All Rights Reserved.