You need to create a DataSource for your MysQL database. Look in the examples folder of JBoss (docs/examples/jca) there are a whole bunch of sample DataSource files. Just copy mysql-ds.xml (changing the relevant bits obviously), put it in your deploy directory, check you have the required Driver in your JBoss classpath and start the server.
Originally posted by norman richards: Put the driver in server/default/lib. Copy mysql-ds.xml into your deploy directory. Edit the hostname/databasename/username/password values. That's it.
Umm. I've done this exact sequence once for a J2EE training where we used JBoss and MyEclipseIDE. However, I would feel better if there would be a way to include the datasource definition as part of the application itself. Is there such a way?
Again, the ideal in my opinion would be that whatever needs to be done to a plain vanilla installation of the application server could be done inside the .ear file -- a bit like the Context XML for Tomcat web applications.