wood burning stoves*
The moose likes JDBC and the fly likes JDBC Connect problem on Linux: com.mysql.jdbc.Driver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC Connect problem on Linux: com.mysql.jdbc.Driver" Watch "JDBC Connect problem on Linux: com.mysql.jdbc.Driver" New topic

JDBC Connect problem on Linux: com.mysql.jdbc.Driver

Norman Meister

Joined: Jul 03, 2009
Posts: 17

Hi All,
I have a simple java application which reads data from the DB. The application works fine on windows. I have added the 'mysql-connector-java-5.1.22-bin.jar' in my windows classpath.
The problem comes when i copy the application on linux and run it. I getthe following exception:

I have read various articles on setting classpath in linux, but couldn't get through and I am still unclear as to how to set the classpath in linux?

I even copied the 'mysql-connector-java-5.1.22-bin.jar' in my project src folder where the .class file is generated but still no success.

I also tried setting the classpath at runtime by: export CLASSPATH=/opt/integra/middleware/LCPAnalyzer/src/mysql-connector-java-5.1.22-bin.jar

but then i got the follwoing exception:

I am totally lost as how to proceed now. Could someone please suggest a permanent way to set classpath in linux. I have few other java mail api related jars as well, which i would want to set in the classpath in linux but first want to resolve this mysql connector problem.

Any help woudl really be appreciated.

jQuery in Action, 2nd edition
subject: JDBC Connect problem on Linux: com.mysql.jdbc.Driver
Similar Threads
how to setup mysql connector j to work in linux
Problem with loading driver
Exception in thread "main" java.lang.NoClassDefFoundError
Exception in thread "main" java.lang.NoClassDefFoundError: Voice1
not able to connect to the database