Skip site navigation (1) Skip section navigation (2)

Re: Re: [INTERFACES] jdbc: v7.1 bug (letter accent)

From: Jean-Francois Burdet <Jean-Francois(dot)Burdet(at)adm(dot)unige(dot)ch>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Re: [INTERFACES] jdbc: v7.1 bug (letter accent)
Date: 2001-01-30 09:37:06
Message-ID: 3A768B42.8BED16AB@adm.unige.ch (view raw or flat)
Thread:
Lists: pgsql-interfacespgsql-jdbc
After doing some search, I found that encoding used for the JDBC
connection
default to the JVM encoding, so I had add a Property to the connection :
info.put("user","fsft");
info.put("password","fsft");
info.put("charSet", "ISO8859_1");
dbCon = DriverManager.getConnection(url,info);

And quoted from Barry :
>  Let me explain a little bit more what is happening here.
>  In 7.0, the jdbc driver always used the clients default encoding to
>  convert text returned from the database into java Strings. This
>  obviously isn't correct when the DB happens to be running with a
>  different character set than the client.
>  So in 7.1 the jdbc drivers have been changed to detect the character set
>  of the database (by making the select getdatabaseencoding(); call). So
>  if your database was created with the wrong character set (i.e. not
>  latin1), then this change in behaviour would account for your problem. 
>  Likewise if the database was created with the correct character set, it
>  should work fine without setting any additional properties.
>  As you point out, in 7.1 it is also possible to override the character
>  set used by setting the property you have mentioned below. However this
>  should not be necessary if the database is created with the correct
>  character set.

In response to

pgsql-interfaces by date

Next:From: Michael StephensonDate: 2001-01-30 09:39:13
Subject: Re: [PATCHES] Re: [INTERFACES] Patch for JDBC timestamp problems
Previous:From: Peter T MountDate: 2001-01-30 09:11:39
Subject: Re: Postgresql and JDBC

pgsql-jdbc by date

Next:From: Michael StephensonDate: 2001-01-30 09:39:13
Subject: Re: [PATCHES] Re: [INTERFACES] Patch for JDBC timestamp problems
Previous:From: Peter T MountDate: 2001-01-30 09:23:50
Subject: Re: Re: Patch for jdbc Makefile

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group