title: spring batch use data source instead of jdbc using batch-db2.properties
body: <p>I am fairly new to spring batch. I have it working embedded inside my spring mvc web application. It is using a db2 database data store to log job information. At present my batch-db2.properties reads as...</p>
  
  <pre><code>batch.jdbc.driver=com.ibm.db2.jcc.DB2Driver
  batch.jdbc.url=&lt;&lt;my database url&gt;&gt;
  batch.jdbc.user=&lt;&lt;my database user&gt;&gt;
  batch.jdbc.password=&lt;&lt;my database password&gt;&gt;
  batch.schema=&lt;&lt;my database scehma&gt;&gt;
  batch.jndi.name=jdbc/&lt;&lt;my jndi url&gt;&gt;
  </code></pre>
  
  <p>So I've set both jdbc properties and well as the jndi property. The jobs are running fine but my question is what type of connection is my spring batch installation using.</p>
  
  <p>If both are set does it use jdbc or jndi? Also can someone point me to the spring batch documentation page where it gives more information about these settings. I could not find it.</p>
  
  <p>Here is my data source configuration....</p>
  
  <pre><code>&lt;beans profile="server"&gt;     
  
      &lt;bean id="ePosDataSource" 
          class="org.springframework.jndi.JndiObjectFactoryBean"
          p:jndiName="java:comp/env/jdbc/reportingManagerDataSource"
          p:lookupOnStartup="false"
          p:cache="true"
          p:proxyInterface="javax.sql.DataSource"/&gt;
  
      &lt;jee:jndi-lookup id="ePosDataSource"
          jndi-name="jdbc/reportingManagerDataSource"
          cache="true"
          resource-ref="true"
          lookup-on-startup="false"
          proxy-interface="javax.sql.DataSource"/&gt;    
  
      &lt;bean id="custDbDataSource" 
          class="org.springframework.jndi.JndiObjectFactoryBean"
          p:jndiName="java:comp/env/jdbc/reportingManagerCustDbDataSource"
          p:lookupOnStartup="false"
          p:cache="true"
          p:proxyInterface="javax.sql.DataSource" /&gt;          
  
      &lt;jee:jndi-lookup id="custDbDataSource"
          jndi-name="jdbc/reportingManagerCustDbDataSource"
          cache="true"
          resource-ref="true"
          lookup-on-startup="false"
          proxy-interface="javax.sql.DataSource"/&gt;                            
  &lt;/beans&gt;
  </code></pre>
  
  <p>thanks!</p>