Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IBM DB2 AS400 data encoding issue

 
echarish Kumar
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

We are using IBM DB2 AS400 DB and we have a leagacy DB which is being encoded with EBCDIC encoding to store japanese double byte characters, the problem is when i am trying to access this with JAVA code i am getting all junk characters. can anyone help with this as how to convert the Result set data to a proper values.

here is the example of the junk charater
ギフケン ヨウロウグン , ヨウロウチヨウ , ァ£ァカ・ォゥ`ゥオゥヒ

These are the three sample columns having double byte Katakana and Kanji characters but when i fetch them with java i get this junk characters.

Any help regarding PLEASE.
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EBCDIC? Which kind of EBCDIC is that?

And when you access the data, which database driver are you using? And what parameters did you specify in the JDBC URL? Does the driver have parameters for specifying charset?

And what characters are you actually seeing? What you posted looks like Japanese to me, so "all junk characters" doesn't agree with what you posted. Also, how are you displaying the characters? Did you check them as soon as you got them from the database, or did you do something else with them (like displaying them at the console) as well?

You're going to have to look at the details. Just telling us you have a problem isn't helpful.
 
echarish Kumar
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Encoding at DB is
CCSID 5035 (decimal)
13AB (hex)
Name JAPAN MIX EBCDIC

here are the details
driver = "com.ibm.as400.access.AS400JDBCDriver"
url = "jdbc:as400B_IP;prompt=false"

the Output charactes which i have written those i have took from the Debug in Eclipse, and even when i print them on console they are printed the same.
And yes these characters looks like japanese but they are suppose to be Double Byte Characters, but they get converted.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic