• Post Reply Bookmark Topic Watch Topic
  • New Topic

Database driver not found

 
Tontang Bei
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Database driver not found java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver" is the exception that is printed to my console.

below is the code in the servlet that is causing this exception:

String dbURL = "jdbc:mysql://localhost/murach";

Here is what I dont get when I was accesing this servlet from an immidiate JSP page previously it worked. But when I add another JSP to call the JSP that was calling this servlet I get this strange exception.

Any help welcome
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65516
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where did you put the jar file containing the driver?
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put the jar containing the driver classes in lib directory of WEB-INF folder.
 
Tontang Bei
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ive gotten it to work. it was an issue with the driver.
 
Tontang Bei
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The driver problem was creeping up again. I tried Rahul's suggestion of making the lib folder and got that work too. Thanks man.

PS: Just occurred.... Congratulations on Posting 1K. !!!
[ April 30, 2007: Message edited by: Tontang Bei ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!