You will need 30 *-ds.xml files. There is no way, within the Java code that requests a data source, to specify an IP address for the connection. In addtion, such a capability would make connection pooling a real mess.
I wont know the ip of the database they want to make a connection to until the web service call is made. Currently I have a class that extends AbstractPasswordCredentialLoginModule that determines that sets the username and password if I know the IP address here can I dynamically set which datasource that the call will need?
PasswordCredential cred = new PasswordCredential(userName, password.toCharArray());
could I cred.setManagedConnectionFactory(XXX)
where would i go do do something like this