title: Spring Batch: Passing runtime parameters to query in ItemReader
body: <p>I have a spring batch program which reads from one database and writes to a file.</p>
  
  <p>It has item reader as below:</p>
  
  <pre><code>&lt;beans:bean id="myItemReader" class="org.springframework.batch.item.database.JdbcCursorItemReader"&gt;
      &lt;beans:property name="dataSource" ref="jobRepository-dataSource" /&gt;
      &lt;beans:property name="sql" value="${dbTofileDataReadSQL}"/&gt;
      &lt;beans:property name="rowMapper"&gt;
          &lt;beans:bean class="com.mypackage.MyRowMapper" /&gt;
      &lt;/beans:property&gt;
  &lt;/beans:bean&gt;
  </code></pre>
  
  <p>The sql is something like:</p>
  
  <pre><code>select one, two, three, four from myTable where business_date='12/12/11'
  </code></pre>
  
  <p>This line will go into my properties file:</p>
  
  <pre><code>dbTofileDataReadSQL = select one, two, three, four from myTable where business_date='12/12/11'
  </code></pre>
  
  <p>How to pass this business date at run time in the item reader so that it gets added in item reader. </p>
  
  <p>Thanks for reading!!</p>