code: public static byte[] getBlobColumn(final ResultSet rs, final String columnName) throws SQLException {
  		try {
  			final Blob blob = rs.getBlob(columnName);
  			if (blob == null) {
  				return null;
  			}
  
  			final InputStream is = blob.getBinaryStream();
  			final ByteArrayOutputStream bos = new ByteArrayOutputStream();
  
  			if (is == null) {
  				return null;
  			} else {
  				final byte buffer[] = new byte[64];
  				int c = is.read(buffer);
  				while (c > 0) {
  					bos.write(buffer, 0, c);
  					c = is.read(buffer);
  				}
  				return bos.toByteArray();
  			}
  		} catch (final IOException e) {
  			throw new SQLException("Failed to read BLOB column due to IOException: " + e.getMessage());
  		}
  	}
docs: //////////////////////////////////////////////////////////////////////////////////////