Write the mysql-ds.xml and place it on server/default/deploy (if default is used as the server)
<? Xml version = "1.0" encoding = "UTF-8"?>
<! -- $ Id: mysql-ds.xml, v 1.3 14:37:40 loubyansky Exp $ -->
<! -- Datasource config for MySQL using 3.0.9 available from:
Http://www.mysql.com/downloads/api-jdbc-stable.html
-->
<Datasources>
<Local-tx-datasource>
<Jndi-name> MySqlDSForum </jndi-name>
<Connection-url> jdbc: mysql: // localhost: 3306/dbname </connection-url>
<Driver-class> com. mysql. jdbc. Driver </driver-class>
<User-name> xxx </user-name>
<Password> xxx </password>
<Min-pool-size> 5 </min-pool-size>
<Max-pool-size> 30 </max-pool-size>
<Idle-timeout-minutes> 0 </idle-timeout-minutes>
<! -- Corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
<Metadata>
<Type-mapping> mySQL </type-mapping>
</Metadata>
</Local-tx-datasource>
</Datasources>
Make sure that the mysql driver is on classpath or on server/lib.