In my understanding the *-ds.xml files are configuration for the environment because of what you explain. A developer might use a local DB and does not know the productive environment.
For this I never pack such configuration into an application.
The DB properties must only known by admin, if you pack it into the application it will be easy to read the configuration which break the security.
Ok. By your answer I have to assume that there is no way of dynamically change the values of *-ds.xml files when they are packaged with the EAR file.
So the next question is, What can be done to dynamically change the values(user, pw, url) of a datasource when a EAR app is deployed?
AFAIK there is a new feature for getConnection(user,passwd), but I'm not sure in which release it was (I suppose AS7.2, and I don't think that this will go to AS4/5/6)