Re: PostgreSQL JDBC Unicode Support

Started by Tatsuo Ishiialmost 25 years ago2 messages
#1Tatsuo Ishii
t-ishii@sra.co.jp

[Cced: to PostgreSQL hackers list]

Alexander,

I believe this problem was fixed in the latest JDBC driver, that is
supposed to be shipped with 7.1. It asks your database which encoding
is used for particular database while connecting to the database. So
you should be able to see "select getdatabaseencoding" if you turn on
a debugging option for postmaster.

I also think the latest driver is compatible with 7.0.3, but I'm not
sure. Peter T?
--
Tatsuo Ishii

From: "Alexander Vaysman" <avaysman@numerix.com>
Subject: PostgreSQL JDBC Unicode Support
Date: Thu, 15 Mar 2001 15:34:43 -0500
Message-ID: <PFEFILJCOGAEAEJICCHBMENCCAAA.avaysman@numerix.com>

Show quoted text

Tatsuo,

my name is Alex Vaysman, and I saw your numerous posts in the newsgroups
regarding Postgres and mutli-language support. I have a problem with our
Postgres database, and intensive searches on the Internet/newsgroups didn't
provide me with an answer. I was wondering if you would know the answer or
point me towards it.

In the nutshell, we are trying to get Postgres DB running that supports
Unicode and interacts with clients via JDBC. We have PostgreSQL version
7.0.3 installed. I have downloaded the latest JDBC driver from
http://jdbc.postgresql.org.

I have created a Unicode database (confirmed through \l command in psql,
reported encoding is 'UNICODE'). In that DB I've created a table with two
fields integer and varchar(64). Then I store a record into this table. In my
code I specify the string through Unicode escapes. After that I retrieve
this value and write it out. I don't get my value back but rather ?????. I'm
attaching the code I use for reference.

My Internet searches for the solution indicated that I need to apply some
patches to JDBC driver. However, I don't know how to do that. Do you know
where I may download the JDBC driver version with the appropriate patches
applied? If you're using one, would you be kind enough and e-mail it to me.
Also, having some experience with SQL Server, I know that if I wanted to
store Unicode values into some column I was creating that column as nvarchar
rather the varchar. Is anything like this required for Postgres?

Your help is greatly appreciated. Thanks in advance,

Alex Vaysman.

#2Peter T Mount
peter@retep.org.uk
In reply to: Tatsuo Ishii (#1)
Re: Re: PostgreSQL JDBC Unicode Support

Quoting Tatsuo Ishii <t-ishii@sra.co.jp>:

[Cced: to PostgreSQL hackers list]

Alexander,

I believe this problem was fixed in the latest JDBC driver, that is
supposed to be shipped with 7.1. It asks your database which encoding
is used for particular database while connecting to the database. So
you should be able to see "select getdatabaseencoding" if you turn on
a debugging option for postmaster.

I also think the latest driver is compatible with 7.0.3, but I'm not
sure. Peter T?

It should be at the basic level, but methods in DatabaseMetaData will fail as
they are specific to 7.1's system table changes etc.

Peter

--
Tatsuo Ishii

From: "Alexander Vaysman" <avaysman@numerix.com>
Subject: PostgreSQL JDBC Unicode Support
Date: Thu, 15 Mar 2001 15:34:43 -0500
Message-ID: <PFEFILJCOGAEAEJICCHBMENCCAAA.avaysman@numerix.com>

Tatsuo,

my name is Alex Vaysman, and I saw your numerous posts in the

newsgroups

regarding Postgres and mutli-language support. I have a problem with

our

Postgres database, and intensive searches on the Internet/newsgroups

didn't

provide me with an answer. I was wondering if you would know the

answer or

point me towards it.

In the nutshell, we are trying to get Postgres DB running that

supports

Unicode and interacts with clients via JDBC. We have PostgreSQL

version

7.0.3 installed. I have downloaded the latest JDBC driver from
http://jdbc.postgresql.org.

I have created a Unicode database (confirmed through \l command in

psql,

reported encoding is 'UNICODE'). In that DB I've created a table with

two

fields integer and varchar(64). Then I store a record into this table.

In my

code I specify the string through Unicode escapes. After that I

retrieve

this value and write it out. I don't get my value back but rather

?????. I'm

attaching the code I use for reference.

My Internet searches for the solution indicated that I need to apply

some

patches to JDBC driver. However, I don't know how to do that. Do you

know

where I may download the JDBC driver version with the appropriate

patches

applied? If you're using one, would you be kind enough and e-mail it

to me.

Also, having some experience with SQL Server, I know that if I wanted

to

store Unicode values into some column I was creating that column as

nvarchar

rather the varchar. Is anything like this required for Postgres?

Your help is greatly appreciated. Thanks in advance,

Alex Vaysman.

---------------------------(end of
broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

--
Peter Mount peter@retep.org.uk
PostgreSQL JDBC Driver: http://www.retep.org.uk/postgres/
RetepPDF PDF library for Java: http://www.retep.org.uk/pdf/