Trouble connecting

Поиск
Список
Период
Сортировка
От Antonie C Malan
Тема Trouble connecting
Дата
Msg-id 200210211620.28688.malan2000@optusnet.com.au
обсуждение исходный текст
Список pgsql-jdbc
Hi All,

I have a Mandrake 9.0 setup.  The Postgresql came with it as did the drivers.
I also downloaded an driver package from the postgresql site, no luck.

-- These are the relevant bits of my code:
String url = "jdbc:postgresql://localhost:5432/Patients";
        Connection conn = null;
        java.sql.Statement stmnt = null;
        java.sql.ResultSet result = null;
        try{
          Class.forName("org.postgresql.Driver");
          conn = DriverManager.getConnection(url, user, pwd);
User and password (pwd) are fed in as string from the command line.

This is as far as it gets before an exception is thrown.

I did import java.sql.* and tried three different driver packages -
jdbc7.1-1.2.jar, jdbc7.2dev-1.2.jar and downloaded and tried pgjdbc2.jar from
the PostgreSQL site.  At different times they all were in the classpath.
These are all precompiled packages and should run on my JDK1.4.0

The following exception is thrown:
java.sql.SQLException: Driver not found for URL:
jdbc:postgresql://localhost:5432/Patients


Note that it is not a ClassNotFoundException, so it seems the driverpackage is
found and used.  I tried different things with the URL, like:
jdbc:postgresql:Patients
all to no avail.

I've also tried to get a driver that supports this URL in a roundabout way
doing something like DriverManager.getDriver(String url) - It returns a  null
driver. Details may be different for this last ploy - I don't have the API
open at the moment. Looks as if there is something wrong with the drivers
I've got.  I can connect to the database from a term and using Postgresql
Access.

I am out of ideas with my back against the wall.  I'll be grateful for any
help.

Chris Malan
malan2000@optusnet.com.au

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

Предыдущее
От: Jean-Christian Imbeault
Дата:
Сообщение: null: was is the default returned value?
Следующее
От: Toby
Дата:
Сообщение: Re: null: was is the default returned value?