A JDBC driver problem

From: "Ahmed Huwait" <huwait(at)cs(dot)purdue(dot)edu>
To: "JDBC Group" <pgsql-jdbc(at)postgresql(dot)org>
Subject: A JDBC driver problem
Date: 2002-08-31 01:08:19
Message-ID: 019c01c2508a$e4e1fe00$83070a80@ad.cs.purdue.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

I'm developing a java program using jdbc, this program is supposed to be able to connect to any kind of database using its url, username, and password. What I did already, is to make it connect to oracle databse using the url: jdbc:oracle:thin:@oracle.cs.purdue.edu:1521:orb and for driver registration I used:
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

What I'm asking about is, how to get the suitable driver for a certain database using its url, & how can I register it so I can connect to the database?

I used this line:

Driver d = DriverManager.getDrivers("jdbc:oracle:thin:@oracle.cs.purdue.edu:1521:orb");

it returns a driver, which appears -when u print it- as: oracle(dot)jdbc(dot)driver(dot)OracleDriver(at)20dcd9
while the line:
System.out.println(new oracle.jdbc.driver.OracleDriver());
prints: oracle(dot)jdbc(dot)driver(dot)OracleDriver(at)5f5897

but when I try to register the Driver d, the connection failed, cause of no suitable driver...

can you help me with that?

--------------------------------------------------------------------------------

Ahmed Huwait
Computer Science Department,
Purdue University,
West Lafayette, IN, USA.

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Thomas O'Dowd 2002-08-31 01:11:07 ant version.
Previous Message Dave Cramer 2002-08-31 00:18:20 Re: 7.0 - 7.2 upgrade, org.postgresql.Driver Class not found