Two things and config files you have to deploy:
1) in the directory
"deploy" of your JBoss server you define the datasource by a file named "xxxxxx-ds.xml". It looks something like
Code:
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>someName</jndi-name>
<connection-url>jdbc:mysql://localhost/schemaName</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>usrname</user-name>
<password>morethansecret</password>
(....)
--
read the JBoss docs about datasources!2) if you have an EJB/JPA application, then create a directory named "META-INF" in the root classpath. There, you deploy the hibernate configuration file named "persistence.xml". It looks something like this:
Code:
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="yourName">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/someName</jta-data-source>
<mapping-file>META-INF/orm_xyz.xml</mapping-file>
<class>org.myboss.base.domain.Check</class>
(...)
<properties>
<property name="hibernate.default_schema" value="schemaName"/>
(... other Hibernate properties)
--
read the Hibernate documentation.
Then: - sit back: and you will see: it works!