File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Problem Connecting mySQL and JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Problem Connecting mySQL and JSP" Watch "Problem Connecting mySQL and JSP" New topic

Problem Connecting mySQL and JSP

N Nanda
Ranch Hand

Joined: Feb 09, 2004
Posts: 62
I have put the driver in the folder /usr/java/j2sdk1.4.2_03/jre/lib/ext/ as specified by the vendor. I am using following string in Class.forName()...
With this I am able to work in JDBC from Java applications. But when I am trying to use this in JSP, it is showing me following exception.
java.lang.NoClassDefFoundError com.mysql.jdbc.Driver Null
Please help me. It is urgent
Thanks in advance.
N Nanda.
Craig Jackson
Ranch Hand

Joined: Mar 19, 2002
Posts: 405
If you driver is a part of jar file, you can place a copy of the jar file in the
/WEB-INF/lib/ folder or you can extract the jar file and place the packages in the WEB-INF/classes/ folder of your web application. For example /WEB-INF/classes/com/mysql/jdbc/Driver.class.

I hope this helps.
I agree. Here's the link:
subject: Problem Connecting mySQL and JSP
It's not a secret anymore!