Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
A lot of people cry when they cut onions. The trick is not to form an emotional bond. This tiny ad told me:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic