aspose file tools*
The moose likes JDBC and the fly likes how to setup mysql connector j to work in linux Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "how to setup mysql connector j to work in linux" Watch "how to setup mysql connector j to work in linux" New topic
Author

how to setup mysql connector j to work in linux

Kenneth Owino
Greenhorn

Joined: Aug 09, 2010
Posts: 23
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.
 
Consider Paul's rocket mass heater.
 
subject: how to setup mysql connector j to work in linux
 
Similar Threads
Problem with JDBC connection with MySQL
Exception in thread "main" java.lang.NoClassDefFoundError
another JDBC driver question
not able to connect to the database
Exception in thread "main" java.lang.NoClassDefFoundError: Voice1