aspose file tools*
The moose likes JDBC and the fly likes Need to store the Chinese character in the Java String variable from the ResultSet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Need to store the Chinese character in the Java String variable from the ResultSet" Watch "Need to store the Chinese character in the Java String variable from the ResultSet" New topic
Author

Need to store the Chinese character in the Java String variable from the ResultSet

Balaji Soundarajan
Ranch Hand

Joined: Jan 23, 2009
Posts: 59
Hi,

I am having Oracle database. Through the select query i am fetching some chinese character record from the database. The query is working fine in the Oracle side, I can able to see the chinese character. But from the resultset i can't able to set it to the java string. The chinese character are replaced with some ? (Question mark) character.

In my java class

String strRetID = rs.getString(2);

after the line execution the strRetID holds some non chinese character like(?).

How to resolve the problem? Please do the needful.

Regards
--Balaji.S
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Assuming your database is configured to support Unicode (from memory its not the default option for Oracle) and whatever you are using to view the data is using the right character encoding there should not be a problem.

Have a read of this very good article.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Need to store the Chinese character in the Java String variable from the ResultSet
 
Similar Threads
store unicode
Loading Chinese characters into Oracle
Problem with Prepared Statements
How to store the Chinese character value in the Java.
Chinese characters