My java file jdbc11.java was compiled successfully with javac jdbc11.java
command in cmd, after that when I tried to to run java jdbc11
I got this exception:
java.lang.ClassNotFoundException: com.mysql.jdbc:Driver
refering to this code in the file
Class.forName("com.mysql.jdbc.Driver");
, when I tried it in eclipse ,I added to "Java Build Path" the external jar : mysql-connector-java-5.1.20-bin.jar
and it run successfully .
in case I didn't fix it with eclipse what should I done in the first try with java jdbc11
command in order to make work ?
note: the jar in the same dir with the jdbc11.java