Re: Problem to connect from host via JDBC ...

From: <tsmets(at)brutele(dot)be>
To: "pgsql jdbc" <pgsql-jdbc(at)postgresql(dot)org>
Cc: <nick(at)fankhausers(dot)com>
Subject: Re: Problem to connect from host via JDBC ...
Date: 2002-03-06 08:21:15
Message-ID: 011201c1c4eb$446df4e0$6501a8c0@calvin
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Conclusion of all these is that the /etc/init.d/postresql start command
contains now :
su -l postgres -c "/usr/bin/pg_ctl -D ${PGDATA} -p
/usr/bin/postmaster -o '-i' start" >/dev/null 2>&1

The JDBC url is now with the following structure :
conn = DriverManager.getConnection( "jdbc:postgresql://" + <HOST> +
"/" + <DB_NAME>, <user>, <pwd> );

However & "contrary" to what is specified on Nick's site I did not need to
set the "tcpip_socket" to "1".
As the exerpt from the "postgresql.conf" shows here below :
<snip>
#
# Connection Parameters
#
#tcpip_socket = false
#ssl = false

#max_connections = 32 # 1-1024

#port = 5432
#hostname_lookup = false
#show_source_port = false

#unix_socket_directory = ''
#unix_socket_group = ''
#unix_socket_permissions = 0777

#virtual_host = ''

#krb_server_keyfile = ''
</snip>

Will need to read more about that in the future :-))

Tx very much to the precious help !

Thomas,
Thomas,

--
Thomas SMETS
rue J. Wytsmanstraat 62
1050 Bruxelles
yahoo-id : smetsthomas
----- Original Message -----
From: <tsmets(at)brutele(dot)be>
To: "pgsql jdbc" <pgsql-jdbc(at)postgresql(dot)org>
Sent: 05 March, 2002 9:47 AM
Subject: [JDBC] Problem to connect from host via JDBC ...

>
>
> I configured the postgres DB to start with :
> /usr/bin/postmaster -o -i -D ${PGDATA}
> which I manually start with the "-d 5 & "@ the end.
>
> The "psql" commands works fine locally.
>
> pg_hda.conf contains the following line :
> # The same, over Unix-socket connections:
> #
> # local all 192.168.1.0 255.255.255.0 trust
> host all 192.168.1.0 255.255.255.0 trust
>
> Of course my network is 192.168.1.0 with a subnetmask of 255.255.255.0
>
> Trying to connect from another machine via JDBC gives the following error
:
> "1109 [main] WARN org.test.JDBCPostgres.TestJDBCPostgres - Message :
> Connection refused. Check that the hostname and port is correct, and that
> the postmaster is running with the -i flag, which enables TCP/IP
> networking."
>
> Which is definitevely the case :
> $ ps -ef | grep post
> postgres 6525 6456 0 14:40 pts/0 00:00:00
> /usr/bin/postmaster -o -i -D /da
>
> Does some one knows what is going wrong ?
>
> Thomas,
>
> --
> Thomas SMETS
> rue J. Wytsmanstraat 62
> 1050 Bruxelles
> yahoo-id : smetsthomas
>
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Rouyre Frédéric 2002-03-06 08:44:37 Re: Problem to connect from host via JDBC ...
Previous Message tsmets 2002-03-06 07:49:07 Re: Problem to connect from host via JDBC ...