Retrieving multiple BLOBs in mySql
Posted by: Arie Fishler
Date: November 28, 2004 07:17AM

Hi,

I am having problems retrieving multiple BLOBs using a SELECT statement. when the result of the select is more than a single row, there is no BLOB returned from the Resultset. The same code has no problems retrieving the BLOB when the ResultSet contains a single row only.

Also, is it true that in any case, even if the ResultSet contains more than a single row, the actual action when retrieving the BLOBs would be to access the DB for every BLOB separately. Thia means that if I have 5 rows, I will get 5 DB access times instead of a single access compared to a regular SELECT that retireves multiple rows with no BLOBs.

The code I am using to retrieve the BLOB from the ResultSet:

Blob wrapBlob = rs.getBlob(PRICE_WRAP);
if (wrapBlob != null) {
try {
InputStream is = wrapBlob.getBinaryStream();
ObjectInputStream objInputStream = new ObjectInputStream(is);
wrap = (PriceWrap)objInputStream.readObject();
}
catch (Exception e) {
Monitor.log(SearchDb.SEARCH_DB, Monitor.ERROR, e);
}
}

Options: ReplyQuote


Subject
Written By
Posted
Retrieving multiple BLOBs in mySql
November 28, 2004 07:17AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.