There is no such critter. I wish it was that simple but due to the needed elements that lie outside the war you need to roll up your sleeves and dig in.

First I need to let you know I may not be able to respond in a timely manner. Busy schedule.

Now I will assume you have reviewed http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html for a per context and

http://tomcat.apache.org/tomcat-5.5-doc/config/globalresources.html for a global approach.

Now for a few questions.

Is the jndi for one app or several?

Well if for one app, you can set it up in the context of the app. If for several you need it to be global.

Difference is that for global you move the parts to the server.xml and add a pointer to the context called a resource link.

Both cases you need to add the drivers to the common/lib (thus the reason a simple war won't do).

One common mistake is spelling errors and case issues. Make sure the names match exactly. You will also need to restart Tomcat to make it work. One suggestion I have is as a test to use the default connection method of:


Class.forName("com.mysql.jdbc.Driver");

   connection =
    DriverManager.getConnection(
     "jdbc:mysql://192.168.1.19:3306/golive",
     "daname",
     "depassword");

This will test the database and the drivers. If this fails you need to resolve these issue first then move on.

If you search the archives you will find several discussions on this topic and I am involved in many of them.

Doug

----- Original Message ----- From: "Stephen More" <[EMAIL PROTECTED]>
To: <users@tomcat.apache.org>
Sent: Wednesday, May 17, 2006 5:34 PM
Subject: Help with Tomcat & MySQL using JNDI


Is there a war file available for download that will do nothing more than:
   select 'HelloWorld from MySQL'; using JNDI ?


I have tried following many examples on the web and I keep ending up with:
   Cannot create JDBC driver of class '' for connect URL 'null'

At this point I am pulling out my hair and thinking their must be a
bug in tomcat 5.5.17 !

Can anyone provide me with a simple working war using MySQL ?


-Thanks
Steve More

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to