B.6.2. MySQL Local-TX Datasource

Example B.21. MySQL Local-TX Datasource

This example uses a database hosted on localhost, on port 3306, with autoReconnect enabled. This is not a recommended configuration, unless you do not need any Transactions support.
<datasources> 
  <local-tx-datasource> 
    
    <jndi-name>MySqlDS</jndi-name> 
    
    <connection-url>jdbc:mysql://localhost:3306/database</connection-url> 
    <driver-class>com.mysql.jdbc.Driver</driver-class> 
    
    <user-name>username</user-name> 
    <password>secret</password> 
    
    <connection-property name="autoReconnect">true</connection-property>
    
    <!-- Typemapping for JBoss 4.0 --> 
    <metadata> 
      <type-mapping>mySQL</type-mapping> 
    </metadata> 
    
  </local-tx-datasource> 
</datasources>