-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: need advice to store word documents Using Hibernate
PostPosted: Thu Nov 12, 2009 11:12 am 
Newbie

Joined: Thu Nov 12, 2009 11:10 am
Posts: 3
Hello,

I have to store MS word documents in MYSQL database.
I am using Java Hibernate as an ORM. Please advice how to define objects for this.

Best Regards,
Jai
http://bonjour.manjil-groups.com/


Top
 Profile  
 
 Post subject: Re: need advice to store word documents Using Hibernate
PostPosted: Thu Nov 12, 2009 1:04 pm 
Beginner
Beginner

Joined: Tue Oct 30, 2007 7:57 am
Posts: 47
There are 2 options:

a) Use a field of type blob and save the document as a stream
b) Instead, codify the data to base64, and save using a clob


Top
 Profile  
 
 Post subject: Re: need advice to store word documents Using Hibernate
PostPosted: Fri Nov 13, 2009 8:24 am 
Newbie

Joined: Thu Nov 12, 2009 11:10 am
Posts: 3
Hello,

Thanks for the suggestion.
I tried to upload the document using byte[] in my Data Object and maping it as binary in hbm.xml
It is saving it properly but while downloading, the file is not the same as the uploaded one. I mean, it loses the encoding and some strange characters appears when try to open the file.
Please advice.

Best Regards,
Jai


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.