I have a variable OBJECT_ID stored in DB2 as OBJECT_ID VARCHAR() FOR BIT DATA NOT NULL.
How can I retrieve the String value stored in it?
I have tried following code to convert Binary to String in Java as:
String str = resultset.getObject("OBJECT_ID").toString();
int charCode = Integer.parseInt(str,2);
String str1 = new Character((char)charCode).toString();
But it throws following:
NumberFormatException: For input string : "[B@475e586c"
Sure the String is not an Integer but how can I retrieve the String value of a VARCHAR() FOR BIT DATA from DB2 in my java program?
String str = resultset.getString("OBJECT_ID");Sure the String is not an Integerso the question is, why you parse it as an int?