Re: Question about connection java and Postgresql in Linux

From: Paul Thomas <paul(at)tmsl(dot)demon(dot)co(dot)uk>
To: "pgsql-general (at) postgresql (dot) org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Question about connection java and Postgresql in Linux
Date: 2003-09-20 20:31:12
Message-ID: 20030920213112.C8980@bacon
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On 20/09/2003 15:23 DN wrote:
> I am trying to use Redhat Linux 9, J2sdk 1.4.2 and Postgresql 7.3.2 to
> do my setting. But, I cannot access the database to set/get data
> through the java program. Please help give me some suggestions.
> Here is what my setting and problems:
> http://hk.geocities.com/daisy_nhy/java_postgresql2.html
>
> Thanks

The postgreSQL .jar file must go in common/lib _not_ share/lib. Two other
things:

1) have you enabled tcpip on the postmaster by seting

tcpip_socket = true

in /var/lib/pgsql/data/postgresql.conf

2) have you edited /var/lib/pgsql/data/pg_hba.conf to un-comment the line

# host all all 127.0.0.1 255.255.255.255 trust

because if you haven't done both of these, you won't be able to connect
from Java.

And before anybody jumps in, I'll just point out that the "host" line is
far too permissive to be used in production but if you're just starting
out experimenting with PostgreSQL and Java, it's one less thing to have to
worry about for now.

HTH

--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller
Business |
| Computer Consultants |
http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-09-20 20:37:19 Re: Can't Build 7.3.4 on OS X
Previous Message Oliver Elphick 2003-09-20 20:25:55 Re: 7.3.2 client connecting to 7.2.1 server problem