title: Spring Batch JDBCCursorItemReader
body: <p>Is there any better way to load sql from file system to inject in JDBCCursorItemReader.
  I want to load sql query from files instead of hardcoding in the configuration file.</p>
  
  <pre class="lang-xml prettyprint-override"><code>//spring bean    
  &lt;bean id="jdbcReader" class="com.sample.DatabaseReader"&gt;
      &lt;property name="sql" value="query.sql"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>and then i extended JDBCCursorItemReader</p>
  
  <pre class="lang-java prettyprint-override"><code>//extended cursoritemreader
  class DatabaseReader extends JDBCCursorItemReader {
  
      //Overriden method
      @Override
      public void setSql(String fileName) {
          //file
          File f = new File(fileName);
          //read file from given path
          String query = FileCopyUtils.copyToString(f);
          //pass the query
          super.setSQL(query);
  
      }
  }
  </code></pre>