2 Replies Latest reply on Jan 28, 2005 11:20 AM by ishq

    Problem in running example

    ishq

      Hello!!

      I was successfull in tryoing out the ejb 3 samples. But i wanted to try the cmp examples with another datasource e.g. with firebird or oracle. What should i do to keep the things running.

      I would very thankful for ur kind reply

      Regards
      IshQ

        • 1. Re: Problem in running example
          stralnet

          I've found the following pages helpful in getting CVS EJB3 Entity beans to use MySQL and Postgres for persistence.


          http://docs.jboss.org/ejb3/reference/hibernate.html

          http://www.hibernate.org/hib_docs/reference/en/html/session-configuration.html

          From the hibernate page I learnt you can either set up a database source in JBoss and point hibernate to that (I think this is the prefered way)

          Or you point hibernate directly to the database (this is what I did for development)

          This is what my hibernate.properties looks like...

          hibernate.connection.driver_class=com.mysql.jdbc.Driver
          hibernate.connection.url=jdbc:mysql://localhost:3306/database
          hibernate.connection.username=username
          hibernate.connection.password=password
          hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
          hibernate.dialect=org.hibernate.dialect.MySQLDialect
          #hibernate.hbm2ddl.auto=create-drop
          hibernate.hbm2ddl.auto=update
          


          (the commented out create-drop line will kill everything in your database every time your ejb3 deploys, changed to update to stop this)

          • 2. Re: Problem in running example
            ishq

            Thanks alot for the reply. it works perfectly now