You reported similar topic as me in 'http://www.jboss.org/index.html?module=bb&op=viewtopic&t=62276'
My situation is more annoying as I have to modify Java files as well to switch the DB. It is my first BIG dissapointment after a year of using JBoss.
Unfortunately I cannot help you, I don't see any way to do it (at least in 3.2.x). Just idea - if possible to have the way of retrieving metadata of descriptors and changing some parameters (like datasource-mapping) just after deployment of jar/ear.
From what I've read, in the 4.x series there is a way to abstract this information out. Unfortunately, I can't expect some of our customers to accept a major app server version change for this.
Any ideas anyone? Could I write an MBean that set some property somehow?
You could try to change the default DS settings for each installtion (if you dont keep all these identical). Set the in conf/standardjbosscmp-jdbc.xml for the data source for that server. Might work, but not sure if resolving datasource-mapping works. Browsing the DTD for 3.2, it says that datasource and datasource-mapping are optional (either none or both). It would be nice if the datasource-mapping could be looked up for the given datasource.