I have scenario below I have all my files (HW2.java
and 3 jar files for JDBC/ODBC) in folder src
. I am running the following commands but still getting errors but the above code runs fine in eclipse, the problem comes only when code in run via command line:
src> javac -cp ".:*.jar" HW2.java
src>java -cp ".:*.jar" HW2 window building 10 20 300 400
Error: Could not find or load main class HW2
src> java HW2 window building 10 20 300 400
java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@localhost:
1521:orcl
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at HW2.DBconnect(HW2.java:22)
Could anyone tell me how to run correctly?