[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Questions about using libpgjava



On Wed, Jan 29, 2003 at 09:57:08PM -0800, Anthony Green wrote:
> That's right - it works very well.  If you're using a recent version of
> gcj, you should be able to check the sources out from
> http://sources.redhat.com/rhug and simply configure/make/install a
> shared library version of this driver.
 
Thank you very much for the pointer.  It took me a while to get everything
set up properly -- as you might've guessed, since this reply is two weeks
old -- but I did finally manage to get the drivers to build properly.
 
Unfortunately, I'm now encountering run-time errors which I'm having
trouble diagnosing.  When running the basic.java example provided with the
drivers, I receive the following output:
 
   PostgreSQL basic test v6.3 rev 1

   Connecting to Database URL =3D jdbc:postgresql:test
   Exception caught.
   java.sql.SQLException: Driver not found for URL: jdbc:postgresql:test
 
The output indicates that the Class.forName("org.postgresql.Driver") line
executes successfully, and that the exception is thrown when a connection
is attempted with DriverManager.getConnection(); the stack trace confirms
this.  I receive this error whether I compile the program with GCJ 3.2 and
the drivers provided by the Debian libpgjava package, or GCJ 3.3 (checked
out of CVS on 10 February) and the drivers provided by rhug.
 
The PostgreSQL JDBC documentation I've found, including the main
documentation on postgresql.org, suggests that this error occurs when
Class.forName() is executed, and the URL to the database is malformed.
However, in my case, the exception is being thrown later, and to the best I
can tell I provide the URL correctly.
 
I was able to find e-mail describing a similar problem on the pgsql-jdbc
mailing list; see
<http://archives.postgresql.org/pgsql-jdbc/2002-11/msg00222.php>.  Most of
the follow-ups suggest that there is a misconfiguration with the database.
I have confirmed that PostgreSQL is accepting TCP/IP connections; I can see
it running on port 5432 with lsof, and can telnet to it.  I haven't
configured PostgreSQL beyond questions that I was asked by debconf when
installing the Debian package.
 
At this point, I'm stumped again.  If anybody has any suggestions as to
where the problem might lie, they would be a tremendous help.
 
Thanks again everyone,

-- 
-- Brett Smith

Attachment: pgpc7z4UJ9029.pgp
Description: PGP signature


Reply to: