jQuery in Action, 2nd edition*
The moose likes Object Relational Mapping and the fly likes Getting an error while returning a blob using Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Getting an error while returning a blob using Hibernate" Watch "Getting an error while returning a blob using Hibernate" New topic
Author

Getting an error while returning a blob using Hibernate

Steve Vittoria
Ranch Hand

Joined: Jan 12, 2005
Posts: 33

Hi everyone,

I'm working on a web service that retrieves a blob from an Oracle DB and returns it to the client. Based on what I've read online, it seems that the best way to do this is to convert the blob to a byte array and return the byte array to the client. However I'm not quite sure where in my code I should be converting the blob to byte[].

Here is my class that was generated by Hibernate...


Here is the class with my query...


Here is the method that the client application calls to get the blob (along with some other fields)...


I was thinking of doing the conversion in the method called by the client, but I get the following error on the first statement in the getRealTemplates() method...


So I`m not sure where I must do the conversion. Any help would be greatly appreciated.

Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting an error while returning a blob using Hibernate
 
Similar Threads
Exception when webservice is invoked
ejb3.0,hybernate,MySQL
Error while calling webservice client from EJB3 SLB Local interface.
get generated key
ERROR [org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS] SOAP request exception