I am running Eclipse 3.0.1 with MyEclipse 3.8.4 on a Pentium 4 machine running 
Windows XP Pro. I have MySQL 4.1 and JBoss 4. I've created a Web Project in 
Eclipse and want to connect to MySQL from within a method in a class that is 
called by a servlet. I've had a look at chapter 8 of the Getting Started with 
JBoss 4.0 Guide and get the impression that I have a lot to do to get to the 
point where I'll know how to get my program to tell JBoss where to find MySQL's 
JDBC driver. Is there a "quick" way to do this? I know that 
Class.forName("com.mysql.jdbc.Driver") coded in a simple java program being run 
under Eclipse works fine but in a Web application deployed and then run under 
JBoss 4 within Eclipse, I get a ClassNotFoundException and its getMessage() 
method returns "No ClassLoaders found for: com.mysql.jdbc.Driver".
I found this on the Internet: 

Context jndiContext = new InitialContext();
DataSouce ds = 
jndiContext.lookup("java:/ConnectionPool");
Connection con = 
ds.getConnection();

It came with this explanation: "When using an EJB container, deployment 
descriptors outside of the application specify the JDBC Driver Class and DB URL 
for the connection pool you use called ConnectionPoolName. This way the 
container can be configured and a different database selected independently 
from your source code."

How do I find that connection pool name? What/Where is the deployment 
descriptor in which the JDBC Driver Class and DB URL are specified? 

Getting Started's chapter 8 gives me the impression that I'd need to mess with 
configuration issues everytime I create an application that needs to get to 
MySQL. That can't be right can it?  

Am I more confused than I need to be? 

THANK YOU in advance-  

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

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


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to