The user is specific to the *-ds.xml.
Only way is to use multiple *-ds.xml configuration, but indeed it is not dynamic and might a connection overload of the database.
I have a theory that it could be done with a custom JCA LoginModule but I haven't looked into it more closely (and it's for the JCA forum)
I did this a while back with JBoss 4.2.2. I would dynamically create a DS, then load it in the jNDI tree, with part of the path based on the company name of the user. Code would then retrieve connection from JNDI based on the user's company name. Neat thing was, I set the min connection value in the connection pool to 0, so if nobody was actually using that connection, the connections would close. The specifics won't work for JBoss 5, but you might be able to adapt them. I posted this on the mailing list ages ago, and the forum some time ago. If you need and can't find, let me know. If you wind up using this solution and patching for JBoss 5., I would appreciate an email to where you posted the upgrade.
I found something in the configuration.
You can use <application-mananged-security/> within the *-ds.xml (see generic-ds.xml) docs/examples/jca.
You are able to use getConnectio(use,psw) within the application. I'm not sure whether this is practicable with JPA ;-)
Also I'm not sure what the behaviour of pool is.