JBoss AS is no longer maintained by its owner. Oracle does not provide support for JBoss AS. The Connector/J integration for JBoss is provided "as-is" and may stop functioning or be removed at anytime without notice.
These instructions cover JBoss-4.x. To make the JDBC driver
classes available to the application server, put the JBoss common
JDBC wrapper JAR archive (available from, for example, the Maven
Central Repository at
http://central.maven.org/maven2/jboss/jboss-common-jdbc-wrapper/)
into the lib
directory for your server
configuration (which is usually called
default
). Then, in the same configuration
directory, in the subdirectory named deploy
,
create a datasource configuration file that ends with
-ds.xml
, which tells JBoss to deploy this file
as a JDBC Datasource. The file should have the following contents:
<datasources>
<local-tx-datasource>
<jndi-name>MySQLDB</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/dbname</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>user</user-name>
<password>pass</password>
<min-pool-size>5</min-pool-size>
<max-pool-size>20</max-pool-size>
<idle-timeout-minutes>5</idle-timeout-minutes>
<exception-sorter-class-name>
com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorter
</exception-sorter-class-name>
<valid-connection-checker-class-name>
com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker
</valid-connection-checker-class-name>
</local-tx-datasource>
</datasources>