title: How to run Spring batch app using CommandLineJobRunner (spring + hibernate and/or war deployment)
body: <p>I need to create batch jobs using Spring Batch. </p>
  
  <p>Job will access oracle DB then fetch records, process them in tasklet and commit results.</p>
  
  <p>I am planning to use hibernate with spring to deal with data.
  Jobs will be executed via AutoSys. I am using CommandLineJobRunner as entry point. </p>
  
  <p>(Extra info - I am using DynamicWebProject converted to Gradle, STS, Spring 4.0, Hibernate 5.0, NO Spring Boot)</p>
  
  <p>I have few queries/doubts about this entire application. They are more towards environment/deployment.</p>
  
  <ol>
  <li>Do I need to deploy this whole app as a war in Tomcat(or any server) to instantiate all beans(spring and hibernate)?</li>
  <li>If yes, how can I start jobs using CommandLineJobRunner ?</li>
  <li>If no, I will have to manually instantiate beans in main method using ClassPathXmlApplicationContext. In this case how should I execute jobs ? Do I need to create jar(is this mandatory)  ?</li>
  <li>How can I test these jobs on command line ? Do I need to pass jars(spring , hibernate etc dependencies) while using CommandLineJobRunner to execute jobs ?</li>
  </ol>
  
  <p>I am new to batch jobs and all your comments would be of great help. </p>
  
  <p>Thanks</p>