JDBC connection issue - Mailing list pgsql-jdbc

From Young Nam
Subject JDBC connection issue
Date
Msg-id 581C48EBC132FF459E62A6809D0D72AE22C749@mail.sharedmarketing.com
Whole thread Raw
Responses Re: JDBC connection issue
List pgsql-jdbc
Hi,

I am having some difficulties connecting to a local postgresql database via jdbc driver.

my setup is:
mandrake 10.0
j2sdk1.4.2
postgresql 7.4.3

I've configured postgresql from its source with --with-java option, make, and make install.

The default directory for the postgresql.jar is /usr/local/pgsql/share/java/postgresql.jar
I've run >jar -tf /usr/local/pgsql/share/java/postgresql.jar and the class files seem to be in the right order.

I've added the following line to the pg_hba.conf to test local connections via jdbc driver.
local    all    all    127.0.0.1    trust

Also, changed the postgresql.conf
tcpip_socket = true

Added CLASSPATH to bashrc file
export CLASSPATH=/usr/local/pgsql/share/java/postgresql.jar:${CLASSPATH}

and I am trying to run the following code
import java.sql.*;
import java.util.*;

public class Xlang {
    public static void main(String[] args) {
        try {
            Class.forName("org.postgresql.Driver");
        ...
    }
}

and I am getting the following exception..

java.lang.ClassNotFoundException: org.postgresql.Driver

Any ideas would be very much appreciated.

YJ

pgsql-jdbc by date:

Previous
From: Steven Bell
Date:
Subject: Retrieving User information
Next
From: Bill Chandler
Date:
Subject: Re: [PERFORM] Cursors performance