Hi there,

I'm running Postgresql 7.2.1 on Mac OS X 10.1.5 and can't connect via
jdbc. Any help would be great. Thanks....

I can connect without problems to the database via psql as in
psql dbname
I have the following in pg_hpa.conf
local
all trust
host all 192.168.1.0 255.255.255.0 trust

Postgres postmaster is started up at system boot by calling the
following function:

startPostgres()
{
if [ "${POSTGRES:=-YES-}" = "-YES-" ]; then
ConsoleMessage "Starting PostgreSQL database server"
# Some trickery to get around tcsh's inability to
# handle this redirect
#
su - postgres -c 'sh -c "/usr/local/bin/postmaster -i -D
/usr/local/pgsql/data >> /usr/local/pgsql/logfile 2>&1 &"'
fi

I'm using the TestPostgreSQL.java file from
http://www.entropy.ch/software/macosx/postgresql/
Compiles fine.
then doing the following I get

[localhost:/Users/Shared] postgres% java -classpath
/usr/local/pgsql/share/java/postgresql.jar:. TestPostgreSQL
Exception in thread "main" Something unusual has occured to cause the
driver to fail. Please report this exception: Exception:
java.sql.SQLException: FATAL 1: No pg_hba.conf entry for host
192.168.1.2, user postgres, database template1

Stack Trace:

java.sql.SQLException: FATAL 1: No pg_hba.conf entry for host
192.168.1.2, user postgres, database template1

at org.postgresql.Connection.openConnection(Connection.java:178)
at org.postgresql.Driver.connect(Driver.java:149)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:177)
at TestPostgreSQL.main(TestPostgreSQL.java:75)
End of Stack Trace

at org.postgresql.Driver.connect(Driver.java:166)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:177)
at TestPostgreSQL.main(TestPostgreSQL.java:75)
[localhost:/Users/Shared] postgres%


What would be going wrong?

with regards,

--
Lachlan Deck
ldeck@tpg.com.au

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-novice @
categoriespostgresql
postedNov 13, '02 at 5:27p
activeNov 13, '02 at 5:27p
posts1
users1
websitepostgresql.org
irc#postgresql

1 user in discussion

Lachlan Deck: 1 post

People

Translate

site design / logo © 2022 Grokbase