I have a Derby SQL database in which I have a table containing a blob field that needs to contain a serialized object. I access it through JDBC. The problem is that when I de-serialize the object using a ResultSet all works fine, but if I use a CachedRowSet I get a "Data Type Mismatch" Exception.
Here is the bit of code that works:
ResultSet rs = stmt.executeQuery();
rs.next();
byte[] buf = rs.getBytes("albero");
Here is the alternative bit tha
CachedRowSet crs = null;
ResultSet rs = stmt.executeQuery();
crs = RowSetProvider.newFactory().createCachedRowSet();
crs.populate(rs);
crs.next();
byte[] buf = crs.getBytes("albero");
Could anyone help me understand why this different behaviour? Thanks