postgresql+win1250 + java(tomcat)

Jakub Spicak jakub.spicak na deltaes.cz
Středa Únor 4 10:56:50 CET 2004


Ve veci JDBC vs. PostgreSQL jsem nekde nasel tuto informaci, ktera mi hodne 
pomohla pri praci s cestinou, treba i Vam:

You shouldn't need to pass any encoding and you certainly shouldn't pass an 
encoding that is different than the database encoding.

If the database is created with LATIN2 (verify by 'select 
getdatabaseencoding()' from psql) then the jdbc driver will automatically 
convert from/to the database encoding to/from the unicode internal 
representation java uses.

If you explicitly set an encoding different than the database is using you 
will likely have problems since then the driver will convert from/to this 
encoding instead of the encoding the database is using.


Jozef Chocholacek wrote:

> Martin Spevak wrote:
> 
>>  mam jeden problem s kodovanim v DB. Udaje zapisane v db su win1250
>> (precitam som ich cez php a nastavil hlavicku... vsetko sa zobrazilo
>> spravne)
>> ...
> 
> 
>   V akom kódovaní je vytvorená databáza? (Čo máte v stĺpci "Encoding", 
> keď zadáte v psql príkaz "\l"?)
> 
>   Inak pre DB URI pre PostgreSQL JDBC ovládač existuje parameter 
> charSet, ktorý je dobré nastaviť na kódovanie databázy, napr. 
> jdbc:postgresql://localhost:5432/mojadb?charSet=LATIN2, vo vašom prípade 
> teda asi Cp1250 (prípadne windows-1250, neviem, čo z toho vezme ovládač).
> 
> 
> J.Ch.

-- 
.......................................
.   Jakub Špičák                      .
.   DELTA E.S., s.r.o. Brno           .
.   Hvězdová 13                       .
.   Czech Republic                    .
.                                     .
.   e-mail: jakub.spicak na deltaes.cz   .
.   phone:  +420 5 4524 2603          .
.   fax:    +420 5 4524 2591          .
.   icq:    171816362                 .
.......................................


Další informace o konferenci Test