From: | Antonie C Malan <malan2000(at)optusnet(dot)com(dot)au> |
---|---|
To: | pgsql-jdbc <pgsql-jdbc(at)postgresql(dot)org> |
Subject: | Trouble connecting |
Date: | 2002-10-21 06:20:28 |
Message-ID: | 200210211620.28688.malan2000@optusnet.com.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)optusnet(dot)com(dot)au
From | Date | Subject | |
---|---|---|---|
Next Message | Toby | 2002-10-21 08:14:04 | Re: null: was is the default returned value? |
Previous Message | Jean-Christian Imbeault | 2002-10-21 05:49:02 | null: was is the default returned value? |