retrieve chinese data from oracle db using JDBC thin driver

Hi every expert,

I had a problemabout chinese charset.

I retrieved the chinese data from oracle db using JDBC thin driver.

The output format likes "0xE999B3E7A78BE6B19FE38080E38080E38080".

I think it is the problem of the charset conversion.

I put the part of the program:

*The part of the connection -

DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

String drivers = "oracle.jdbc.driver.oracleDriver";

sysProps.put("jdbc.drivers", drivers.toString());

sysProps.setProperty("LANGUAGE", "zht_taiwan");

sysProps.setProperty("CHARSET","big5");

sysProps.put("user","AAA");

sysProps.put("password","BBB");

String url = "jdbc:oracle:thin:@LH0001:1521:LH0001DB";

connTable = DriverManager.getConnection(url, sysProps);

*The part of the resultset:

import java.sql.*;

oracle.sql.CHAR ChineseWord;

int OracleID = oracle.sql.CharacterSet.ZHT16BIG5_CHARSET;

oracle.sql.CharacterSet Big5CharSet = oracle.sql.CharacterSet.make(OracleID);

try {

ChineseWord = new oracle.sql.CHAR(rsTable.getString("Filed1"), Big5CharSet);

strField1 = ChineseWord.toString();

}

*classpath setting:

%ORACLE_HOME%/jdbc/lib/classes12.zip and %ORACLE_HOME%/jdbc/lib/nls_charset12.zip

[1337 byte] By [WilsonCKH] at [2007-9-26 4:01:30]
# 1
Hello,What's the charset of your database? Mine is AMERICAN_AMERICA.UTF8In this case, I could successfully insert and retrieve the Chinese characters without any encoding parameter in the getString() method. Perhaps you could try it.
quentinw at 2007-6-29 12:57:20 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
The charset of the database is "TRADITIONAL CHINESE_TAIWAN.ZHT16BIG5".Can I use "sun.io.ByteToCharBig5" and how can I use it?
WilsonCKH at 2007-6-29 12:57:20 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...