You need two things:
- Make the JDBC driver available for your application server
- Data Source Configuration Record
For # 1, you can download the JAR containing the JDBC driver and place it in the following directory:
$JBOSS_HOME/server/default/lib
Assuming it $JBOSS_HOMEpoints to your JBoss installation, and you use the installation default.
For # 2 you will find many examples here:
$JBOSS_HOME/docs/examples/jca
. PostgreSQL:
<datasources>
<local-tx-datasource>
<jndi-name>PostgresDS</jndi-name>
<connection-url>jdbc:postgresql://[servername]:[port]/[database name]</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>x</user-name>
<password>y</password>
<metadata>
<type-mapping>PostgreSQL 7.2</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>