A quick note about Spring Profiles
Spring Profiles are cool little tools to enable you to keep your configuration together and yet cater for different environments. (such as testing datasources versus production datasources). The neat thing to note is that the "
in the example above, it allows you to define two beans with the same name, and have the "local" configuration automatically overwrite the production.
here's the stackoverflow question where i try and put this together http://stackoverflow.com/questions/16062922/using-jndi-datasource-with-spring-batch-admin/16080997