Forums Register Login

reading blob and displaying the word document

+Pie Number of slices to send: Send
Hi,

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).

The blob field is 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.



For this, the output I am getting is junk with some text. But the text is like A,s,d,f,g,h,j,k. I am not sure if this is right.

I also tried



Any help in this would be greatly appreciated.

Thanks

[ January 04, 2007: Message edited by: vjy chin ]
[ January 11, 2007: Message edited by: vjy chin ]
+Pie Number of slices to send: Send
You can just call rs.getBytes() to get a byte array for a BLOB. No need to write the logic yourself when it is in the driver.

If you print the output, it should look like junk because it is binary day. Try writing the byte array to a file called "temp.doc". Then open it in Word to validate it is a good document.
+Pie Number of slices to send: Send
Thanks for the reply.

Actually I need to write the binary word document into another rtf document (the master document).

I need to create a rtf document with several parts. One such part will contain some instructions. This instructions itself is a word document and it should be stored in BLOB field in Oracle.

What I am doing is, I am having a service class where I get all data including instructions data. I am passing instructions data as byte [].(Is there any other better way to pass this? ). I am getting all the info in documentGeneration class. I am appending all the data including the instructions. Then I need to display this Master document which includes the instructions.

Also none of these classes are servlets. SO how can I encode the instructions properly to attach into the Master document. Is there anyway to do it.

Any suggestions for this welcome.

Thanks
To get a wish, you need a genie. To get a genie, you need a lamp. To get a lamp, you need a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 3149 times.
Similar Threads
How to read the blob column from oracle database
Create a ZLib archive using java 1.5
how to retrieve images on a jsp page
Insert/Select Image from Oracle DB.
open a pdf inline using MIME in ie7
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 18:49:17.