Search

A.6.2. MySQL Local-TX Datasource

download PDF

Example A.22. 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> 
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.