Blob data Retrieving in java shows non readable format
I have table in which one column has xml data, so the column type is blob.
When i try to retrieve using java by jdbc. I can extract but when i print
it show the content as non-readable format. What should i do for getting
the proper xml from table?
try {
// Executing the select statement
Blob blob = rs.getBlob("column_name");
// blob is in binary stream
InputStream inStream = blob.getBinaryStream();
BufferedReader bufReader = new BufferedReader(new
InputStreamReader(inStream));
StringBuffer payLoad = new StringBuffer();
String line;
while ((line = bufReader.readLine()) != null ){
payLoad.append(line);
}
inStream.close();
the above code im using for retrieving the blob data db. Anything i need
to correct here ?
No comments:
Post a Comment