If you are using 3.0.x, you will have a *-service.xml file for the first db. Add another copy of the mbean configurations to that file and change the mbean names and the jndi name (and the url:-)
If you are using 3.2, you will have a *-ds.xml file. Copy the local-tx-datasource element and change the jndi-name (and url).
If you want you can have 2 separate files.
Thank you for your help. I configured the 2 datasource correctly as you suggested, but the problem is that I am accessing those datasource outside of the jboss environment. I am acessing it through classes in a web context of tomcat. I found out that jboss doesn't allow datasource connection from classes external to its vm, which is inconvenient, but ok, since tomcat does database pooling as well. I used tomcat's pooling and for anyone else trying to do the same thing, go to apache's site and look for datasource configuration documentation. Thanks again for your reply!