I'm reading an Oracle BLOB from DB and want to convert it to a readable String. The BLOB is text encoded to binary and I'm pretty sure that it was encoded with Base64.
My code of reading the BLOB returns a String with unrecognized characters:
public String getStringFromBLOB(String sql) {
...
resultSet.next();
BLOB blob = null;
blob = ((OracleResultSet) resultSet).getBLOB(1);
byte[] bdata = blob.getBytes(1, (int) blob.length());
String tmpStr =new String(bdata);
str = new String(tmpStr.getBytes("UTF8"), "EUC_KR");
return str;
}
Any help will be much appreciated.
return new String(bdata, "EUC_KR");.