my dog learned polymorphism*
The moose likes JDBC and the fly likes IBM DB2 AS400 data encoding issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "IBM DB2 AS400 data encoding issue" Watch "IBM DB2 AS400 data encoding issue" New topic
Author

IBM DB2 AS400 data encoding issue

echarish Kumar
Ranch Hand

Joined: Feb 02, 2010
Posts: 42
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
Bartender

Joined: Oct 14, 2005
Posts: 18566
    
    8

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

Joined: Feb 02, 2010
Posts: 42
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: IBM DB2 AS400 data encoding issue