Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mySql Driver - ClassNotFoundException

 
Yvette Gonzalez
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I put my mm.mysql-2.0.14-bin.jar file into my JavaHome\jre\lib\ext directory and I am still getting: java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver. Any suggestions? Is there anything else that I need to do?
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Yvette Gonzalez:
I put my mm.mysql-2.0.14-bin.jar file into my JavaHome\jre\lib\ext directory and I am still getting: java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver. Any suggestions? Is there anything else that I need to do?
did you add c:\path\mm.mysql-2.0.14-bin.jar to your classpath?
 
Yvette Gonzalez
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I have put this c:\mySQLDriver\mm.mysql-2.0.14\mm.mysql-2.0.14-bin.jar; in my classpath. I don't know what else to do!
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From where are you trying to load the mySql driver (web-server, standalone program)?
/Rene
 
Yvette Gonzalez
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From a standalone program. Thanks in advance for any assistance!
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are using windows 98/ME - have you then added the driver and a . to the CLASSPATH in autoexec.bat, and restarted your PC?
If windows NT/2000/XP - then you should have added the driver and a . to the CLASSPATH in your 'Environment Variables'.
You can also just use the -classpath option when you compile/run the code
(e.g. javac -classpath .;C:\mysql\jdbc\mm.mysql-2.0.14-bin.jar Test.java).
/Rene
[ June 29, 2002: Message edited by: Rene Larsen ]
 
Yvette Gonzalez
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Rene - I used the -classpath option and it worked!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic