Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JDBC and the fly likes run application with MySql  - driver problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "run application with MySql  - driver problem" Watch "run application with MySql  - driver problem" New topic
Author

run application with MySql - driver problem

Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
Hi everyone,

I'm using eclipse as my IDE and when compiling and running a program with MySql evreything works perfect.

when I export my project to a jar file and trying to run it from the command line I get error msgs - I take it the MySql driver cannot be found.

I'm doing this:
java -cp mysql-connector-java.jar;GTP.jar com.bonn.main.GTP

can someone tell me what's missing?

thanks
Ppr
[ March 03, 2005: Message edited by: Bear Bibeault ]
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


I get error msgs - I take it the MySql driver cannot be found.

Possibly - a "it works in environment X, but not environment Y" problem is usually the classpath. Read the error message - it should tell you what it can't find. Then check the class is in one of the Jars you have listed in the classpath. If you are still stuck - post the stack trace you see and hopefully someone can point you in the right direction.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
the message i get is:

com.mysql.jdbc.Driver

Do I need to specify somthing at the Enviroment Veriable???
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: run application with MySql - driver problem
 
Similar Threads
How to rollback multiple prepared statements
connecting to MySQL in Linux vs. Windows
db connection problem
MySQL Error - no driver
MySql from the command line, driver problem