Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem Connecting mySQL and JSP

 
N Nanda
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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()...
Class.forName("com.mysql.jdbc.Driver")
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
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Craig.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic