I have an external MySQL server that\'s set up and working fine. I created a database connection in Eclipse and can view the database in the Data Source Explorer tab.
You could set up a data source in whatever app server you're deploying your WAR to and fetch a reference to it with JNDI. Or you could package your WAR in an EAR and define the data source in the EAR's data-sources.xml file (and fetch a reference to it with JNDI).