Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have installed Eclipse Luna recently to do programming on JSP. Currently i'm trying to connect it with JDBC. I have downloaded mysql J connector and added mysql-connector-java-5.1.31-bin.jar to the build path. I've trying running in on my browser and i get the following error:

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

I'm pretty sure that my settings are correct in terms of setting the path. I also have set up the CLASSPATH in environment variables just in case that is the main problem, but still i'm facing the same problem.

Can anyone help me?

share|improve this question
    
The CLASSPATH environment variable is almost never used, you shouldn't try to use it. –  Mark Rotteveel Aug 1 at 7:30
    
add the jar to the classpath of your application –  M.Sharma Aug 1 at 8:12

1 Answer 1

Yes your settings are wright for building the application, running it needs other settings. You need to place the jar file either in CATALINA_HOME/lib or in <your-app>/WEB-INF/lib so that the driver is found at run time. The latter is preferable.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.