Configure JNDI/JDBC(MySQL) connection in JBoss

Small snippet that shows how you configure a JNDI connection in JBoss. This connection is a MySQL/JDBC connection. Just name it mysql-ds.xml and but it in the deploy folder on your JBoss-Server.

<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>jdbc/translations</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/translationsdb</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>root</user-name>
<password></password>
<exception-sorter-class-name>
org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter
</exception-sorter-class-name>
<metadata>
<type-mapping>mySQL</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>

Yannick Signer