pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Applet - JDBC?
4+ messages / 4 participants
[nested] [flat]

* Applet - JDBC?
@ 2005-12-20 13:15  Leonardo Ribeiro Queiros <leonardo@eee.ufg.br>
  0 siblings, 2 replies; 4+ messages in thread

From: Leonardo Ribeiro Queiros @ 2005-12-20 13:15 UTC (permalink / raw)
  To: pgsql-jdbc

Greetings,
already I looked some people who work with postgresql in Brazil and not
obtained to explain me as to solve an error of connection gone off when my
applet tries to connect with postgreSQL.  A detailed description of the
error is soon to follow:

Erro: java.net.ConnectException: Connection refused: connect
Erro: Conexão negada. Verifique se o nome da máquina e a porta estão
corretos e se o postmaster está aceitando conexões TCP/IP

I am using [ PostgreSQL 8 ] and the applet meets in the following address:
http://www.ufgen.ufg.br/krub/jsp/graficos/monitoramento/ViewMonitoramento/


PS:  With the DB2 I did not have problems, however I am liking the form of
work with postgreSQL and if I not to obtain to decide this problem of
connection, go to have that to abandon postgreSQL.

In case that it will be possible to help me, I am describing still for its
analysis the archives [ pg_hba.conf ] and [ postgresql.conf ]



[pg_hba.conf]
...
# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD

# "local" is for Unix domain socket connections only
local   all         all                               trust
# IPv4 local connections:
local	all	postgres			trust
host    all     postgres         127.0.0.1	255.255.255.255          trust
host	all	all	0.0.0.0/0	trust
# IPv6 local connections:
#host    all         all         ::1/128               trust
...


[postgresql.conf]
...
listen_addresses = '*'
port = 5432
...

[Parameters that use to load the postmaster]
/usr/local/pgsql/bin/postmaster -i -p 5432 -o -e -D/usr/local/pgsql/data &

Leonardo.





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Applet - JDBC?
@ 2005-12-20 14:01  Roland Walter <rwa@mosaic-ag.com>
  parent: Leonardo Ribeiro Queiros <leonardo@eee.ufg.br>
  1 sibling, 1 reply; 4+ messages in thread

From: Roland Walter @ 2005-12-20 14:01 UTC (permalink / raw)
  To: Leonardo Ribeiro Queiros <leonardo@eee.ufg.br>; +Cc: pgsql-jdbc

"Leonardo Ribeiro Queiros" <leonardo@eee.ufg.br> writes:

> analysis the archives [ pg_hba.conf ] and [ postgresql.conf ]
>
>
>
> [pg_hba.conf]
> ...
> # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
>
> # "local" is for Unix domain socket connections only
> local   all         all                               trust
> # IPv4 local connections:
> local	all	postgres			trust
> host    all     postgres         127.0.0.1	255.255.255.255          trust
> host	all	all	0.0.0.0/0	trust
> # IPv6 local connections:
> #host    all         all         ::1/128               trust


Your pg_hba.conf is missing a line that corresponds to the interface to the world
of the network card.

You should add a line for the subnet your computer is connected to, for example:

host    all         all         172.17.1.87       255.255.248.0     md5

This is for the connection from all computers in my subnet with md5 password-authentication.
If you do not use localhost as hostname in the connection string, this is needed even
for local connections.


-- 
Roland Walter                   mailto: rwa (at) mosaic-ag (dot) com
MOSAIC SOFTWARE AG               phone: +49 (0) 22 25 / 88 2-41 1
Am Pannacker 3                     fax: +49 (0) 22 25 / 88 2-20 1
D-53340 Meckenheim                http://www.mosaic-ag.com


Die in dieser E-Mail enthaltenen Nachrichten und Anhaenge sind ausschliesslich 
fuer den bezeichneten Adressaten bestimmt. Sie koennen rechtlich geschuetzte, 
vertrauliche Informationen enthalten. Falls Sie nicht der bezeichnete Empfaenger
oder zum Empfang dieser E-Mail nicht berechtigt sind, ist die Verwendung,
Vervielfaeltigung oder Weitergabe von Nachrichten und Anhaengen untersagt.
Falls Sie diese E-Mail irrtuemlich erhalten haben, informieren Sie bitte 
unverzueglich den Absender und vernichten Sie die E-Mail.

This e-mail message and any attachment are intended exclusively for the named 
addressee. They may contain confidential information which may also be protected 
by professional secrecy. Unless you are the named addressee (or authorised to
receive for the addressee) you may not copy or use this message or any attachment
or disclose the contents to anyone else. If this e-mail was sent to you by mistake
please notify the sender immediately and delete this e-mail.




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Applet - JDBC?
@ 2005-12-20 16:40  John R Pierce <pierce@hogranch.com>
  parent: Roland Walter <rwa@mosaic-ag.com>
  0 siblings, 0 replies; 4+ messages in thread

From: John R Pierce @ 2005-12-20 16:40 UTC (permalink / raw)
  To: Roland Walter <rwa@mosaic-ag.com>; +Cc: Leonardo Ribeiro Queiros <leonardo@eee.ufg.br>; pgsql-jdbc


>>[pg_hba.conf]
>>...
>># TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
>>
>># "local" is for Unix domain socket connections only
>>local   all         all                               trust
>># IPv4 local connections:
>>local	all	postgres			trust
>>host    all     postgres         127.0.0.1	255.255.255.255          trust
>>host	all	all	0.0.0.0/0	trust
>># IPv6 local connections:
>>#host    all         all         ::1/128               trust
>>    
>>
>
>
>Your pg_hba.conf is missing a line that corresponds to the interface to the world
>of the network card.
>
>You should add a line for the subnet your computer is connected to, for example:
>
>host    all         all         172.17.1.87       255.255.248.0     md5
>
>This is for the connection from all computers in my subnet with md5 password-authentication.
>If you do not use localhost as hostname in the connection string, this is needed even
>for local connections.
>  
>

scary, however, is...

   host	all	all	0.0.0.0/0	trust

I read that to say, trust anyone from any IP to be anyone they say they want to be.

wouldn't that trump your subnet md5 line ?





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Applet - JDBC?
@ 2005-12-20 21:26  Oliver Jowett <oliver@opencloud.com>
  parent: Leonardo Ribeiro Queiros <leonardo@eee.ufg.br>
  1 sibling, 0 replies; 4+ messages in thread

From: Oliver Jowett @ 2005-12-20 21:26 UTC (permalink / raw)
  To: Leonardo Ribeiro Queiros <leonardo@eee.ufg.br>; +Cc: pgsql-jdbc

Leonardo Ribeiro Queiros wrote:

> Erro: java.net.ConnectException: Connection refused: connect
> Erro: Conexão negada. Verifique se o nome da máquina e a porta estão
> corretos e se o postmaster está aceitando conexões TCP/IP

I guess this is a localization of "Connection refused"?

Can you use psql running on the client machine to connect to the server 
successfully? If not, JDBC isn't going to work either. I'd check for 
firewalls between the client and server.

 From JDBC's perspective, it's tried to establish a TCP connection to 
port 5432 on your server and got a connection refused error. There is 
nothing that the driver can do about that, you've got a connectivity 
problem somewhere.

-O



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2005-12-20 21:26 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-12-20 13:15 Applet - JDBC? Leonardo Ribeiro Queiros <leonardo@eee.ufg.br>
2005-12-20 14:01 ` Roland Walter <rwa@mosaic-ag.com>
2005-12-20 16:40   ` John R Pierce <pierce@hogranch.com>
2005-12-20 21:26 ` Oliver Jowett <oliver@opencloud.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox