From: | Barry Lind <blind(at)xythos(dot)com> |
---|---|
To: | dauw <dauw(at)ms9(dot)url(dot)com(dot)tw> |
Cc: | pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: I can't insert the chinese words. |
Date: | 2003-02-19 01:38:05 |
Message-ID: | 3E52DFFD.3000908@xythos.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
When I test this locally it works correctly for me. What character set
is your database created in? (the output of the \l command in psql
should tell you). If order for this to work correctly your database
needs to be created in a character set that supports the characters you
are trying to store. In your case that would be either UNICODE or BIG5.
thanks,
--Barry
dauw wrote:
> Hello all,
> I use the "(2003-02-09) JDBC3 JDK 1.4" JDBC driver to access the DB.
> When I insert the chinese words (local= zh_TW ,"BIG5") into the varchar
> column,it become "???".
> But if I use the pgAdmin to do so ,It is success.
>
> Then I select the ResultSet, The getString() mathod could not get the
> correct words.
> But if I use the sentence " String s =new String(rs.getBytes());" ,The
> string s is correct.
>
> I guess that is caused by char= 16-bit in java2.
>
> Now how can I insert the chinese words (local= zh_TW ,"BIG5") into the
> varchar column by jdbc?
>
> regard
>
> ---------
> OS: windows XP
> JavaVM: j2sdk 1.4.1
> JDBC :JDBC3
> pssql:PostgreSQL 7.3.1
>
> ---Dauw
> dauw(at)ms9(dot)url(dot)com(dot)tw
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>
From | Date | Subject | |
---|---|---|---|
Next Message | Roj Niyogi | 2003-02-19 07:38:06 | JSP AccessControlException error |
Previous Message | Takeo Shibata | 2003-02-18 23:23:01 | SSL for JDBC |