• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getBytes() or getBlob() fails when resultSet is larger than 1

 
Cory Tucker
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a table setup with a column of type BLOB. When I execute a query on the table which returns only one result, I can get the blob data no problem. However, when I execute a query that returns a result set with more than one result, the second time the getBlob() or getBytes() method is called it throws a SQLException and gives the following error:

ERROR XCL30: An IOException was thrown when reading a 'BLOB' from an InputStream.


Here is a snippet of the code I am using:




Does anyone know what might be going wrong?

thanks --Cory
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34218
341
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cory,
Welcome to JavaRanch!

Just to confirm, were you able to get just the second icon if you do a query so that it is the only result? This rules out data as being the cause.

What database/driver are you using?
 
Cory Tucker
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Correct. If I do a query which restricts the resultSet size to 1, then I can get the data just fine.

The DB I am using is JavaDB (aka Derby or Cloudscape). I believe the version is 10.2 (whatever was just released on 12/20/06).
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34218
341
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok. That looks like a message specific to Derby.

An IOException was thrown when reading a '<value>' from an InputStream.

Maybe a network timeout? I haven't used Derby, so I can't provide more specific advice on this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic