Redian新闻
>
[转载] unicode into oracle?
avatar
[转载] unicode into oracle?# Database - 数据库
b*e
1
【 以下文字转载自 Java 讨论区 】
【 原文由 breeze 所发表 】
i have a unicode string that i want to store to an oracle table.. i
tried varchar2 and long, but the result is not readable when I read
them out in a jdbc select nor in toad (with a chinese viwer)
if i print the string before it's inserted into oracle it's fine..
so that means something went wrong during the insert.. what could it
be? my oracle is already set to American/America/UTF8 (the NLS_LANG
setting) and it's oracle 8.1.7.. and i'm using the oci8 dri
avatar
g*n
2
The problem lies in your Chinese viewer. The type VARCHAR2 and getString
should work fine. Try to enable the chinese locale in your NT regional options

dbPassword);
('2343', ?, 'CHINESE')";
BufferedReader(rs2.getCharacterStream("name"));

【在 b****e 的大作中提到】
: 【 以下文字转载自 Java 讨论区 】
: 【 原文由 breeze 所发表 】
: i have a unicode string that i want to store to an oracle table.. i
: tried varchar2 and long, but the result is not readable when I read
: them out in a jdbc select nor in toad (with a chinese viwer)
: if i print the string before it's inserted into oracle it's fine..
: so that means something went wrong during the insert.. what could it
: be? my oracle is already set to American/America/UTF8 (the NLS_LANG
: setting) and it's oracle 8.1.7.. and i'm using the oci8 dri

avatar
b*e
3
well the problem is.. chinese is just an example. i have a file with all kinds
of unicode characters (chinese, japanese, korean, etc) and i need to be able
to save all of them into oracle.

【在 g****n 的大作中提到】
: The problem lies in your Chinese viewer. The type VARCHAR2 and getString
: should work fine. Try to enable the chinese locale in your NT regional options
:
: dbPassword);
: ('2343', ?, 'CHINESE')";
: BufferedReader(rs2.getCharacterStream("name"));

avatar
g*n
4
Then you need to install multiple languages onto your system. UTF8 is only an
encoding mechnism, but you have to have the right software to display the
characters on the screen. To make sure you have the right data stored, why
don't you check the bytes instead of viewing it?

kinds
options
oracle.jdbc.driver.OracleDriver());
dbUserId,
as

【在 b****e 的大作中提到】
: well the problem is.. chinese is just an example. i have a file with all kinds
: of unicode characters (chinese, japanese, korean, etc) and i need to be able
: to save all of them into oracle.

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。