aspose file tools*
The moose likes JDBC and the fly likes Store word documents as blobs using base 64 encoding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Store word documents as blobs using base 64 encoding" Watch "Store word documents as blobs using base 64 encoding" New topic
Author

Store word documents as blobs using base 64 encoding

maruthan nagalingam
Greenhorn

Joined: Jan 05, 2011
Posts: 6
Hi,
It would be helpful if you could help me with this issue.

I need to write sql scripts using base64 encoding to store a word document as blobs in the oracle database. i need to store the word documents as a one shot update using only scripts.. i havent worked on stored procedures as such.. and it would be nice if anyone can give me pointers as to how to start this approach..

thanks
Suman
Fatih Keles
Ranch Hand

Joined: Sep 01, 2005
Posts: 182
Hi maruthan,

Why do you use Base64 encoding since you are already storing file in a BLOB? It will increase the size of data and will bring extra cost of encode/decode operations. If you are not in a special need for Base64 encoded data just store the data as BLOB. You can follow this guide from Oracle site.
maruthan nagalingam
Greenhorn

Joined: Jan 05, 2011
Posts: 6
Hi,
Thanks for your reply.. But my requirement is jus to create procedures or scripts that will insert all the word documents(.docx) as blobs into the database at one shot initially. I am aware that it could be done in the java side.. but my aim is to create scripts to store the .docx file as blobs..After storing it as blobs i need to read the blob ,convert the blobs into docx4j supporting format to open the word document in the web browser. Thats the reason i need to go for base64 encoding. Can you please provide me some approach regarding this.

thanks
Fatih Keles
Ranch Hand

Joined: Sep 01, 2005
Posts: 182
Assuming that you are doing this in Oracle environment, here stackoverflow guys explain how to load a file into a blob with pl/sql. You may find many other sample code, just google it.

For base64 conversion oracle database has a built-in utl_encode package. I hope this will give you a head start.

Regards,
Fatih.
maruthan nagalingam
Greenhorn

Joined: Jan 05, 2011
Posts: 6
Hi Fatih,

Thank you so much for the initial approch to start with.. will go through the pointers and keep you informed..

thanks once again..

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Store word documents as blobs using base 64 encoding
 
Similar Threads
Data Encapsulation
How to render documents on to Pages
Stroring Word Documents into MYSQL Database
Sybase blob column type
Stroring Word Documents into MYSQL Database