
I got exception in thread main no such method error while running servlet. I have added servlet.api.jar file in classpath.my classpath is C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\servlet-api.jar;C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\Demo\WEB-INF\lib\mysql-connector-java-5.1.22\mysql-connector-java-5.1.22-bin.jar

Put mysql-connector-java-5.1.22-bin.jar in tomcat lib also. Restart your server then run your code.

tnx for rply.my problem got solved when i set classpath=%classpath%;.; fom cmd prompt.Now this exception got resolved but browser doesnot show out put.When i tried database conn code in java pgm having main method it runs properly .But when i added same code to servlet browser doesn't show any output.control doesn't reach toward Class.forName(com.mysql.jdbcDriver).the line before class.forName got printed but line after not printed

hi,
May be becoz of mysql jar file.its not recognized by tamcat.can u show ur code?
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.