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.

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3861568#3861568

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3861568


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to