Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Retrieving japanese characters through jdbc

 
ranga rajan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Iam using Jdk1.3 and Oracle 8.1.7. My OS is in english.
The NLS of Oracle database is set to UTF8.
The oracle database contains japanese characters. Iam using a java
program to fetch these japanese characters. Iam using JDBC to do this.
When i fetch this data and display it on the console or write into a file,
it is written as '?'(Question marks.)
I even changed the setting of my OS to support japanese, even then this
continues.
can anyone help me on this.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adding Asian language fonts to the Java Runtime by editing the font.properties files
And rangarajan,
Please change your name to be compliant with JavaRanch's naming policy.
Your displayed name should be 2 separate names with more than 1 letter each. We really would prefer that you use your REAL name.
You can change your name: here.
Thanks,
Cindy
 
ranga rajan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cindy,
I am now able to write the japanese characters retrieved from the database into a file.
Iam also able to read the content of the file and display the content on the console. The displayed characters are proper japanese characters. This i did using the encoding in outputstream objects and did not make any changes in the font.properties.
Now my problem is as follows. Iam not able to store the correct japanese characters directly into a string without writing in the file.
Can u help on this
 
ranga rajan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This problem has been solved. Run the java application using
java -Dfile.encoding=cp943 <Class name>
If u are calling a method of a class from another class u can set this system property using the methods in system and then retrieve those system properties to set ur character set.
This is for the information of all those guys who are suffering as i did.
regards
Rangarajan
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
, Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic