[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.
%
When all four tires fall off your canoe, how many tiny ads does it take to build a doghouse?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|