public void setBlob(int i, Blob x) throws SQLException { checkClosed(); if (x == null) { setNull(i, Types.BLOB); return; } InputStream inStream = x.getBinaryStream(); try { long oid = createBlob(i, inStream, x.length()); setLong(i, oid); } finally { try { inStream.close(); } catch (Exception e) { } } }
public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException { checkClosed(); if (inputStream == null) { setNull(parameterIndex, Types.BLOB); return; } long oid = createBlob(parameterIndex, inputStream, -1); setLong(parameterIndex, oid); }
public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException { checkClosed(); if (inputStream == null) { setNull(parameterIndex, Types.BLOB); return; } if (length < 0) { throw new PSQLException(GT.tr("Invalid stream length {0}.", length), PSQLState.INVALID_PARAMETER_VALUE); } long oid = createBlob(parameterIndex, inputStream, length); setLong(parameterIndex, oid); }
setBlob(parameterIndex, (Blob) in); } else if (in instanceof InputStream) { long oid = createBlob(parameterIndex, (InputStream) in, -1); setLong(parameterIndex, oid); } else {