jdbc program works in IDE but not on command line
Answered
Within the IDE my JDBC program works (so apparently mysql is working OK, my code is OK, etc.), but I can't get it to run from the command line. (I'm still a Java newbie.)
1) I've added mysql-connector-java-5.0.8 (apparently the latest from oracle) to my bash shell CLASSPATH
2) I also included the same in the artifact jar
3) My command line is java -jar /full/path/to/myProject.jar (full path)
MANY THANX IN ADVANCE!
Please sign in to leave a comment.
Oops, the error message (from the bash shell) would help: "No suitable driver found".
Make sure you have this code that loads the driver:
Sample project:
https://dl.dropboxusercontent.com/u/2752840/FunWithJDBC.zip