properly free database resources when done with the processing of BLOBs
This closes
@@ -287,13 +287,14 @@ public class JdbcCommon {
if (blob != null) {
long numChars = blob.length();
byte[] buffer = new byte[(int) numChars];
- InputStream is = blob.getBinaryStream();
+ try (InputStream is = blob.getBinaryStream()) {
int index = 0;
int c = is.read();
while (c >= 0) {
buffer[index++] = (byte) c;
c = is.read();
}
+ }
ByteBuffer bb = ByteBuffer.wrap(buffer);
rec.put(i - 1, bb);
blob.free();
