java.sql.SQLException:No Suitable Driver
837080Feb 4 2011 — edited Feb 5 2011I am be able to connect to Oracle Database via JDeveloper 10g GUI interface with this url:
"jdbc:oracle:thin:@mycompanyhost:1521:SID".
However, when I put this url into the code, I'd get run-time error:
java.sql.SQLException:No Suitable Driver:
at java.sql.DriverManager.getConnection(DriverManager.java:532)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at DB.mypackage.DBQuery.main(DBQuery.java:32)
I added this line in my code to register oracle driver: " DriverManager.registerDriver (new oracle.jdbc.OracleDriver());" But I got an error:"Variable oracle.jdbc.OracleDriver cannot be found." I also added path to jdbc where is has ojdbc5.jar and ojdbc6.jar reside in the environmental variable.
I am new to java app development and have exausted all my knowledge and options. Please advise.
Edited by: 834077 on Feb 4, 2011 3:03 PM