Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to setup mysql connector j to work in linux

 
Kenneth Owino
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I have a problem setting up mysql connector j so I can access my mysql database in linux. I already downloaded mysql-connector-java-5.1.15.tar.gz, extracted its contents and copied mysql-connector-java-5.1.15-bin.jar to /usr/lib/jvm/java-6-sun/ext/ but when i run my code I still get the error message below:

CONCEPT:Unable to Load Driver
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at LoadDriver1.main(LoadDriver1.java:14)
Connecting...
SQLException: No suitable driver found for jdbc:mysql://localhost/mysql?user=userid&password=password
SQLState: 08001
VendorError: 0

Some help on how to go over this is very much welcome.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic