[OCP 21 book] | [OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Originally posted by Patrick Ferguson:
I know I'm beating a dead horse because everyone seems to have this problem and so have I in the past. Usually it is corrected by simply putting the correct .jar file in the classpath. Here is my code and classpath, if anyone can see an obvious problem I'm missing I would appreciate it.
private static Connection connect(String[] s)
{
Connection conn = null;
String sUrl = s[0];
String sUser = s[1];
String sPass = s[2];
try
{
System.out.println("Getting Driver...");
DriverManager.registerDriver( new oracle.jdbc.driver.OracleDriver());
//Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
//Class forName also gives an error
System.out.println("Got Driver!!");
conn = DriverManager.getConnection(sUrl,sUser,sPass);
} catch (Exception sqle) {
sqle.printStackTrace();
}
return conn;
}
C:\Oracle\product\10.1.0\Client_2\jdbc\lib\classes12.jar;C:\Oracle\product\10.1.0\Client_2\jdbc\lib\nls_charset12.jar;C:\JDeveloper\jdk\lib\rowset.jar;C:\Oracle\product\10.1.0\Client_2\jdbc\lib\classes12.zip
Any help would be greatly appreciated.
%
I'm full of tinier men! And a tiny ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
|