[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: How to connect my EJB to firebird database?
andydale
do-not-reply at jboss.com
Mon Jan 29 11:39:02 EST 2007
Hi,
You need to configure a persistence.xml file and then pack it in the META-INF dir of the ejb jar. The persistence.xml will look somethjing like so:
<?xml version="1.0" encoding="UTF-8"?>
| <persistence>
| <persistence-unit name="myPU">
| <jta-data-source>java:/<you firebird ds name></jta-data-source>
| <class><managed class name></class>
| <properties>
| <property name="hibernate.dialect" value="org.hibernate.dialect.FirebirdDialect"/>
| <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
| </properties>
| </persistence-unit>
| </persistence>
You can then inject an EntityManager with the @PersistenceContext annotation within a Session bean.
Cheers,
Andy
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4007885#4007885
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4007885
More information about the jboss-user
mailing list