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

* Problem
@ 2002-11-22 02:02  Vinni <vinni_@yahoo.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Vinni @ 2002-11-22 02:02 UTC (permalink / raw)
  To: pgsql-jdbc


I problem, in my application storage word with accent example "descripción" and view "descripci?n". I use servlet and connection jdbc. 

Anytimes in bd have word with accent "corrección" but read servlet view "correcci?n"

Use linux 7.3, and postgres this version.

After funtion ok in linux 7.1 and this version, i not understand the problem. 

Is linux ? is postgres ? is java-servlets?

Thanks.. 

sorry for my english



---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

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

* Re: Problem
@ 2002-11-27 10:33  Pedro Salazar <pedro-b-salazar@ptinovacao.pt>
  0 siblings, 1 reply; 6+ messages in thread

From: Pedro Salazar @ 2002-11-27 10:33 UTC (permalink / raw)
  To: Vinni <vinni_@yahoo.com>; pgsql-jdbc

Are you using the locale parameter in the JDBC URL to your database
(charSet)?  

For example, to Portugal [PT]
jdbc:postgresql://localhost:5432/db?charSet=PT

regards,
Pedro Salazar

 -----Original Message-----
From: Vinni [mailto:vinni_@yahoo.com]
Sent: sexta-feira, 22 de Novembro de 2002 2:03
To: pgsql-jdbc@postgresql.org
Subject: [JDBC] Problem


I problem, in my application storage word with accent example "descripción"
and view "descripci?n". I use servlet and connection jdbc. 
Anytimes in bd have word with accent "corrección" but read servlet view
"correcci?n"
Use linux 7.3, and postgres this version.
After funtion ok in linux 7.1 and this version, i not understand the
problem. 
Is linux ? is postgres ? is java-servlets?
Thanks.. 
sorry for my english




Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now



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

* Re: Problem
@ 2002-11-27 17:25  Fernando Nasser <fnasser@redhat.com>
  parent: Pedro Salazar <pedro-b-salazar@ptinovacao.pt>
  0 siblings, 0 replies; 6+ messages in thread

From: Fernando Nasser @ 2002-11-27 17:25 UTC (permalink / raw)
  To: Pedro Salazar <pedro-b-salazar@ptinovacao.pt>; +Cc: Vinni <vinni_@yahoo.com>; pgsql-jdbc

Pedro,

charSet seems to be a no-op if te backend is 7.3(beta or whatever).
I don't know what backend version he is using though.

But the system current locale may define what is the JVM platform 
default character encoding.  Maybe this has changed between his Linux 
7.1 and the 7.3 installations.

Regards,
Fernando

Pedro Salazar wrote:
> Are you using the locale parameter in the JDBC URL to your database
> (charSet)?  
> 
> For example, to Portugal [PT]
> jdbc:postgresql://localhost:5432/db?charSet=PT
> 
> regards,
> Pedro Salazar
> 
>  -----Original Message-----
> From: Vinni [mailto:vinni_@yahoo.com]
> Sent: sexta-feira, 22 de Novembro de 2002 2:03
> To: pgsql-jdbc@postgresql.org
> Subject: [JDBC] Problem
> 
> 
> I problem, in my application storage word with accent example "descripción"
> and view "descripci?n". I use servlet and connection jdbc. 
> Anytimes in bd have word with accent "corrección" but read servlet view
> "correcci?n"
> Use linux 7.3, and postgres this version.
> After funtion ok in linux 7.1 and this version, i not understand the
> problem. 
> Is linux ? is postgres ? is java-servlets?
> Thanks.. 
> sorry for my english
> 


-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9




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

* Problem
@ 2009-03-27 17:09  Mauricio Solis <mauricio.solis.h@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Mauricio Solis @ 2009-03-27 17:09 UTC (permalink / raw)
  To: pgsql-jdbc

Hi:
I have a problem wiht de driver.

If the IP address of the postgresql server is wrong, then the aplication 
take a lot of time in finish, iven I try to set 
DriverManager.setLoginTimeout(3), but the problem still.

I used a sniffer (tcpdump) and I realiced that my java aplication insist 
in try to connect to the wrong IP. How I can finish the aplication when 
the IP server is wrong ???


Please Help My





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

* Re: Problem
@ 2009-03-31 07:53  Albe Laurenz <laurenz.albe@wien.gv.at>
  parent: Mauricio Solis <mauricio.solis.h@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Albe Laurenz @ 2009-03-31 07:53 UTC (permalink / raw)
  To: mauricio.solis.h@gmail.com; pgsql-jdbc

Mauricio Solis wrote:
> I have a problem wiht de driver.
> 
> If the IP address of the postgresql server is wrong, then the aplication 
> take a lot of time in finish, iven I try to set 
> DriverManager.setLoginTimeout(3), but the problem still.
> 
> I used a sniffer (tcpdump) and I realiced that my java aplication insist 
> in try to connect to the wrong IP. How I can finish the aplication when 
> the IP server is wrong ???

I don't think that you run into the login timeout here, you rather encounter
a TCP timeout. Before JDBC can connect, a TCP connection must be established.
Since the destination IP address does not exist, your computer is sending
SYN requests that do not receive an answer until the TCP layer "gives up".

You can find this described in chapter 4.2.3.5 of RFC 1122, which also states
that the timeout "for a SYN segment MUST be set large enough to provide
retransmission of the segment for at least 3 minutes".

If you wait long enough, you eventually get an exception, right?
It's just that the length of time it takes is unacceptable for you.

JDBC cannot influence this as it is on a lower layer.

I can think of two options:
- You can configure the TCP stack in your operating system kernel to
  make this timeout shorter. The drawback is that this usually affects
  all connections from this machine and can be a dangerous thing to do.
- You can try to work around it in Java by using threads that watch
  each other and report an error to the user if the connection attempt
  exceeds a certain time.

Maybe you can avoid this problem by not using IP addresses at all.
If you use DNS names, you will get a name resolution error quickly if
you try to connect to a host that does not exist.

Yours,
Laurenz Albe



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

* Re: Problem
@ 2009-03-31 08:31  Oliver Jowett <oliver@opencloud.com>
  parent: Albe Laurenz <laurenz.albe@wien.gv.at>
  0 siblings, 0 replies; 6+ messages in thread

From: Oliver Jowett @ 2009-03-31 08:31 UTC (permalink / raw)
  To: Albe Laurenz <laurenz.albe@wien.gv.at>; +Cc: mauricio.solis.h@gmail.com; pgsql-jdbc

Albe Laurenz wrote:
> Mauricio Solis wrote:
>> I have a problem wiht de driver.
>>
>> If the IP address of the postgresql server is wrong, then the aplication 
>> take a lot of time in finish, iven I try to set 
>> DriverManager.setLoginTimeout(3), but the problem still.
>>
>> I used a sniffer (tcpdump) and I realiced that my java aplication insist 
>> in try to connect to the wrong IP. How I can finish the aplication when 
>> the IP server is wrong ???
> 
> I don't think that you run into the login timeout here, you rather encounter
> a TCP timeout. Before JDBC can connect, a TCP connection must be established.
> Since the destination IP address does not exist, your computer is sending
> SYN requests that do not receive an answer until the TCP layer "gives up".

Yes, but if you set a login timeout the driver will do the connect in a
separate thread, so while that thread is indeed blocked waiting for a
TCP-level timeout, the main application thread should not remain blocked.

Mauricio, do you have a testcase that shows the problem?

-O



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


end of thread, other threads:[~2009-03-31 08:31 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-11-22 02:02 Problem Vinni <vinni_@yahoo.com>
2002-11-27 10:33 Re: Problem Pedro Salazar <pedro-b-salazar@ptinovacao.pt>
2002-11-27 17:25 ` Fernando Nasser <fnasser@redhat.com>
2009-03-27 17:09 Problem Mauricio Solis <mauricio.solis.h@gmail.com>
2009-03-31 07:53 ` Albe Laurenz <laurenz.albe@wien.gv.at>
2009-03-31 08:31   ` 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