4 Replies Latest reply on Jan 11, 2005 6:11 PM by Anil Saldanha

    creating connection pool! please help me!

    Ramazan Pekin Newbie

      I want to connect to mysql db from the ejb. I have learned that I have to create a connection pool. I have looked but I cant find how it is being. first of all I want to explaing what I have done.

      --------------------------------------------------------------------------------------------------------------------------------------------------------------------------

      Step 1: mysql-ds.xml
      a) Take the mysql-ds.xml file located in the [JBOSS_HOME]/docs/examples/jca folder and place it in the deploy folder.

      I have configured this xml file like this:


      <local-tx-datasource>
      <jndi-name>jspNedirMysql</jndi-name>
      <connection-url>jdbc:mysql://localhost:3306/jspNedir</connection-url>
      <driver-class>com.mysql.jdbc.Driver</driver-class>
      <user-name>root</user-name>

      </local-tx-datasource>



      b) Remove the hsqldb-ds.xml from the deploy folder and save it somewhere else.

      Step 2: ejb-deployer.xml
      Edit this file, which is located in the deploy folder.

      a) Find INTERVAL in the file and change this column name to something else. This is required because INTERVAL is a reserved word for MySQL 4.0. The symptom for not having fixed this is am error mentioning INTERVAL bigint when deploying an EJB.

      b) Find other in the file and change this type to text. This is required because type other does not exist in MySQL 4.0.

      Step 3: standardjaws.xml
      Edit this file, which is located in the conf folder of the server. Change the type-mapping of the datasource from Hypersonic SQL to mySQL Note that these names are case sensitive.

      Step 4: JMS configuration descriptors
      a) Remove hsqldb-jdbc2-service.xml from folder deploy/jms. Save this file somewhere else.

      b) Copy mysql-jdbc2-service.xml from folder docs/example/jms to deploy/jms.

      c) Edit mysql-jdbc2-service.xml and change the datasource name if applicable. In my configuration I don't use HSQL at all so I configured the default datasource DefaultDS for MySQL. In this file, change mySQLDS to DefaultDS. Note that datasource names are case sensitive.

      Step 5: Install MySQL Java Connector
      Download MySQL Connector/J and place the file mysql-connector-java-3.0.15-ga-bin.jar in the lib folder of the server.

      --------------------------------------------------------------------------------------------------------------------------------------------------------------------------


      After all of these how can I connect to mysql from ejb, what I have to do? did I create a connection pool with this? please, please, please help me.