• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting an error while returning a blob using Hibernate

Steve Vittoria
Ranch Hand
Posts: 35
Eclipse IDE Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic