A JDBC driver problem

Поиск
Список
Период
Сортировка
От Ahmed Huwait
Тема A JDBC driver problem
Дата
Msg-id 019c01c2508a$e4e1fe00$83070a80@ad.cs.purdue.edu
обсуждение исходный текст
Ответы Re: A JDBC driver problem
Список 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.jdbc.driver.OracleDriver@20dcd9
while the line:
System.out.println(new oracle.jdbc.driver.OracleDriver());
prints:        oracle.jdbc.driver.OracleDriver@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.

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: "Sean Gates"
Дата:
Сообщение: JDBC updateNull method returns null pointer exception
Следующее
От: Harrison
Дата:
Сообщение: Re: 7.0 - 7.2 upgrade, org.postgresql.Driver Class not found