Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Blob to ZIP

 
m sandeep
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have blob data in database which is actually containing a zip file . Now i want to retrieve the blob data from DB and convert it into a zip file .
I am using postgres 8.4 data base .
By doing it normally i am not able to get to see the contents that exists in the file.
Need some suggestion
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is "normally"? What, exactly, is your code doing?
 
m sandeep
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what is this code doing, and how does that differ from what you were expecting?

I notice that you're ignoring the return value of the is.read method call - you can't do that: https://www.coderanch.com/how-to/java/ReadDoesntDoWhatYouThinkItDoes
 
Rob Spoor
Sheriff
Pie
Posts: 20511
54
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And you should check for >= 0, not > 0. 0 is a valid return value that indicates no data is available at this moment, but there could be later on. (I've also edited that FAQ page since it also had > 0.)
 
m sandeep
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Spoor wrote:And you should check for >= 0, not > 0. 0 is a valid return value that indicates no data is available at this moment, but there could be later on. (I've also edited that FAQ page since it also had > 0.)
Thank you Rob and everyone for resolving the issue .It worked
 
Rob Spoor
Sheriff
Pie
Posts: 20511
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic