Deploy one datasource for app a that uses database 1 and one datasource for app b that uses database 2, both of these should be bound using different JNDI names.
Having production and test running in the same JBoss instance is a bad idea though incase your test system takes out the production system.
binding more datasources seems not to be a problem.
But how can I switch from my application from one db to the other. the EJBs would also be the same. How could JBoss recognize which datasource he should use.
My two databases have the same structure. They only differ in their content.