Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in converting RAW data type to String

 
satya kiran
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I retrieved an Oracle RAW data type by
byte b[]= statement.getBytes(n).
Somehow, I need to have the String represtation of this field, and later also need to convert back to the byte[].
When I use new String(b), it just gives me some unreadable symbols.
While at the same time, I know this field have a value like: D1EE971C4852A356E03311227403A356.
I tried using
Byte[] message = rs.getBytes("MessageID");
String str = new String (message); (I also tried using new String(message, "UTF-8"))
Thanks in advance for the help!
Regards,
Satya
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Satya,
Where did the raw data come from originally. Often this problem occurs when there is binary (non-character) data in the bytes.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic