-->
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.  [ 4 posts ] 
Author Message
 Post subject: hibernate3 oracle blob
PostPosted: Sun Jun 25, 2006 4:12 pm 
Newbie

Joined: Sun Jun 25, 2006 1:40 pm
Posts: 2
Hi,

I'm trying to store binary data to OracleDB (10gR2) using hibernate 3.1.3.

I've googled a lot, but everything with problems:
1) http://hansonchar.blogspot.com/2005/06/ ... te-in.html
but doesn't work for the big data
2) http://www.hibernate.org/56.html but ending with error:
org.hibernate.MappingException: Could not determine type for: hibernate.ByteArrayBlobType, for columns: [org.hibernate.mapping.Column(DATA)]

And it makes me crazy !!!

Please could someone point me to final solution ???

Thanks a lot.

Pat


Top
 Profile  
 
 Post subject: I agree...
PostPosted: Mon Jun 26, 2006 11:50 am 
Newbie

Joined: Wed Jan 25, 2006 7:16 pm
Posts: 5
I'm finding the same results...

I've looked at the following link also, and think I have a solution...
http://www.hibernate.org/56.html

I'll update if I get it working...


Top
 Profile  
 
 Post subject: Here is what I came up with...
PostPosted: Mon Jun 26, 2006 4:36 pm 
Newbie

Joined: Wed Jan 25, 2006 7:16 pm
Posts: 5
Just and FYI, I'm using a struts from to upload the file from the client.

Mapped my Oracle table (two columns) the primary key and the blob to the hdb.xml file. Created a POJO of the mapped table with getters and setter for the two columns. This is what I have in my struts action class...

UploadForm uploadForm = (UploadForm)form;
FormFile file = uploadForm.getScannedApp();

factory = (SessionFactory) servlet.getServletContext().getAttribute(HibernatePlugin.KEY_NAME);

session = factory.openSession();
tx = session.beginTransaction();

ScannedApp app = new ScannedApp();
app.setScannedFile(Hibernate.createBlob(file.getInputStream()));

session.save(app);
tx.commit();
session.close();


Top
 Profile  
 
 Post subject: retriev and insert BLOB
PostPosted: Wed Aug 16, 2006 3:28 am 
Newbie

Joined: Wed May 17, 2006 5:10 am
Posts: 14
hi all,
I tried to insert BMP file its size = 2.5 MB , but it failed and throw IO Exception, but it done with no exception in JPEG files

I want to know also, how to retrieve data stored in BLOB?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.