Hi Everyone,
I have an error when I try to connect to a MySQL database in Hibernate using a JBOSS datasource.
I followed these instructions:
http://www.javabeat.net/tips/print.php?tips_id=99
Is there anything else i need?
I have used the reverse engineering functionality successfully and was able to load the database in the Hibernate reverse engineering editor when connecting to the database directly. But it wont work when I change the hibernate.cfg.xml file to point to the datasource in the JBOSS deploy directory.
Code:
<session-factory name="java:hibernate/SessionFactory">
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="connection.datasource">MySqlDS</property>
How does hibernate know which file contains the datasource defined in the hibernate.cfg.xml file ? The filename is mysql-ds.xml. Should the name of the datasource and the file name be the same except for the extension or is there another xml file i need to configure etc.?
The JBOSS datasource is configured appropriately i was able to query the database using a jsp as a test.
Thanks reading my post. If you could help i would appreciate it.