I apologize if this is not in the right forum. I just started using blob. I have gone through many tutorials and forums, but I am not able to make my application work.
I need to retrieve value from blob field in Oracle database. I need to convert that into a byte array. I need to pass that to another class. I need to use this byte array to print a part of document. (The document has many sections, and this blob text is one of the sections).
Also I have no idea of the value in the blob field, (though I think its a word document) and I do not know what encoding is done for it. BTW, is this necessary information, should I need to look at the encoding, if so what encoding is done for word document.
First of all; Blob (Binary large object) is a collection of binary data stored as a single entity in the database. Basically Byte array in the database... So, I am not sure what do you mean with "encoding", if you mean "character encoding", you shouldn't care about it since it is binary data and you do not want to convert it to String.
And here is the code snippet that retrieves BLOG field to Byte array in Java
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
Actually I want the byte array to be converted into a word document.
i.e. A Microsoft Word Document was stored in Blob field. I need to get that and combine into a big master document with some other data. So I need the word document in the way as it was before storage.
Now, I am able to retrieve the Blob data, but its binary format. I need the clear text to display. I tried converting a byte array to String using encodings, but its the same.