1 Reply Latest reply on Jan 2, 2008 7:31 AM by Pete Muir

    MySQL Database with Seam Setup.. IS it correct?

    Tony Herstell Master

      I have tried to copy/edit files to create what I needed and it appears to work. The question is simply is it correct?

      sec_ds.xml

      <?xml version="1.0" encoding="UTF-8"?>
      
      <datasources>
       <local-tx-datasource>
       <jndi-name>secDatasource</jndi-name>
       <connection-url>
       jdbc:mysql://localhost:3306/selwyn
       </connection-url>
       <driver-class>com.mysql.jdbc.Driver</driver-class>
       <user-name>root</user-name>
       <password>******</password>
       </local-tx-datasource>
      </datasources>
      


      persistance.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <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="secDatabase">
       <provider>org.hibernate.ejb.HibernatePersistence</provider>
       <jta-data-source>java:/secDatasource</jta-data-source>
       <properties>
       <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
       <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
       <property name="hibernate.show_sql" value="true"/>
       <!-- These are the default for JBoss EJB3, but not for HEM: -->
       <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
       <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
       </properties>
       </persistence-unit>
      </persistence>
      


      The project is pure Seam/EJB3.

      I know its "obvious" to you guys, but it was not obvious from the doco how to set this up for us mortals...