When i was try to connect to database doing servlets, it was throwing an exception called ClassNotFoundException, but i actually know the meaning of this but the jdbc connectivity is working the general and swing programs, but it was throwing an exception while using servlets, please tell me the solution, I am using Tomcat5.5
Tomcat does NOT use your system environment variables such as classpath to locate a database. You must configure Tomcat with specific database information. I am sure this is all covered in the tomcat-doc section of a typical Tomcat installation.
Originally posted by Rahul Bhattacharjee: As William said , the classpaht is ignored by Tomcat. So where are you putting the driver classes jar.In case of web applications it should be within WEB-INF/lib folder.
This assumes that the original poster is using forName to find the driver which is probably a good assumption since he mentioned that the same code works in a Swing app.