title: How do I swap a jndi datasource lookup to an in memory database for intergration testing?
body: <p>I'm using Spring and Hibernate and want to do some intergration testing with DBUnit. In my application-context.xml I currently specify a datasource via jndi-lookup which reads the jndi-name from a properties file:</p>
  
  <pre><code>&lt;jee:jndi-lookup id="dataSource" 
     jndi-name="${datasource.myapp.jndi}"
     cache="true"
     resource-ref="true"
     proxy-interface="javax.sql.DataSource" /&gt;
  </code></pre>
  
  <p>I'd like to swap this out to an in memory database (hsqldb, h2 etc) for integration testing by just supplying a new properties file, is this possible? Or should I just use a different application-context.xml for the integration testing?</p>