1 Reply Latest reply on Mar 11, 2005 7:41 AM by milowe

    EJB cmp Saving the data in mySql

    da_andrea

      I to all i would like to know if there is a method to save the data of an cmp ejb in a database mysql. I have to use jdbc connection or there is a particular method that i have to write in ejb-jar.xml ?

      thank you very much Andrea from Roma (Italy)

        • 1. Re: EJB cmp Saving the data in mySql
          milowe

          1. Define a DataSource and drop the xml file in your deploy directory. You can find a mysql example in JBOSS_HOME/docs/examples/jca/mysql-ds.xml

          2. Get the jdbc jar and drop it somewhere in classpath, for instance in the lib directory of the server config you are running.

          3. Set persitence xdoclet attributes for your CMP bean @ejb.persistence , @jboss.persistence , ...
          ....
          Or edit the ejb-jar.xml and jbosscmp-jdbc.xml manually.