/** * This opens an existing large object, based on its OID. This method assumes that READ and WRITE * access is required (the default). * * @param oid of large object * @return LargeObject instance providing access to the object * @throws SQLException on error */ public LargeObject open(long oid) throws SQLException { return open(oid, READWRITE, false); }
/** * <p>This deletes a large object.</p> * * <p>It is identical to the delete method, and is supplied as the C API uses unlink.</p> * * @param oid describing object to delete * @throws SQLException on error */ public void unlink(long oid) throws SQLException { delete(oid); }
/** * <p>Returns an {@link InputStream} from this object.</p> * * <p>This {@link InputStream} can then be used in any method that requires an InputStream.</p> * * @return {@link InputStream} from this object * @throws SQLException if a database-access error occurs. */ public InputStream getInputStream() throws SQLException { return new BlobInputStream(this, 4096); }
/** * <p>This creates a large object, returning its OID.</p> * * <p>It defaults to READWRITE for the new object's attributes.</p> * * @return oid of new object * @throws SQLException if something wrong happens */ public long createLO() throws SQLException { return createLO(READWRITE); }
/** * <p>Sets the current position within the object.</p> * * <p>This is similar to the fseek() call in the standard C library. It allows you to have random * access to the large object.</p> * * @param pos position within object from beginning * @throws SQLException if a database-access error occurs. */ public void seek(int pos) throws SQLException { seek(pos, SEEK_SET); }
public LargeObject copy() throws SQLException { return new LargeObject(fp, oid, mode); }
/** * This opens an existing large object, same as previous method, but commits the transaction on * close if asked. * * @param oid of large object * @param commitOnClose commit the transaction when this LOB will be closed * @return LargeObject instance providing access to the object * @throws SQLException on error */ public LargeObject open(long oid, boolean commitOnClose) throws SQLException { return open(oid, READWRITE, commitOnClose); }
/** * This creates a large object, returning its OID. * * <p>It defaults to READWRITE for the new object's attributes. * * @return oid of new object */ public long createLO() throws SQLException { return createLO(READWRITE); }
/** * This deletes a large object. * * @param oid describing object to delete * @exception SQLException on error * @deprecated As of 8.3, replaced by {@link #delete(long)} */ public void delete(int oid) throws SQLException { delete((long)oid); }
public LOIterator(long start) throws SQLException { lo.seek((int) start); }
/** * Returns an {@link InputStream} from this object, that will limit the amount of data that is * visible. * * @param limit maximum number of bytes the resulting stream will serve * @return {@link InputStream} from this object * @throws SQLException if a database-access error occurs. */ public InputStream getInputStream(long limit) throws SQLException { return new BlobInputStream(this, 4096, limit); }
/** * This opens an existing large object, based on its OID. * * @param oid of large object * @param mode mode of open * @return LargeObject instance providing access to the object * @throws SQLException on error */ public LargeObject open(long oid, int mode) throws SQLException { return open(oid, mode, false); }
/** * This creates a large object, returning its OID * * @param mode a bitmask describing different attributes of the new object * @return oid of new object * @exception SQLException on error * @deprecated As of 8.3, replaced by {@link #createLO(int)} */ public int create(int mode) throws SQLException { long oid = createLO(mode); return (int)oid; }
/** * Sets the current position within the object. * * <p>This is similar to the fseek() call in the standard C library. It * allows you to have random access to the large object. * * @param pos position within object from begining * @exception SQLException if a database-access error occurs. */ public void seek(int pos) throws SQLException { seek(pos, SEEK_SET); }
/** * Returns an InputStream from this object. * * <p>This InputStream can then be used in any method that requires an * InputStream. * * @exception SQLException if a database-access error occurs. */ public InputStream getInputStream() throws SQLException { return new BlobInputStream(this, 4096); }
/** * This opens an existing large object, same as previous method, but commits the transaction on * close if asked. * * @param oid of large object * @param mode mode of open * @param commitOnClose commit the transaction when this LOB will be closed * @return LargeObject instance providing access to the object * @throws SQLException on error */ public LargeObject open(int oid, int mode, boolean commitOnClose) throws SQLException { return open((long) oid, mode, commitOnClose); }
/** * This opens an existing large object, same as previous method, but commits the transaction on * close if asked. This is useful when the LOB is returned to a caller which won't take care of * transactions by itself. * * @param oid of large object * @param commitOnClose commit the transaction when this LOB will be closed * @return LargeObject instance providing access to the object * @throws SQLException on error */ public LargeObject open(int oid, boolean commitOnClose) throws SQLException { return open((long) oid, commitOnClose); }
/** * This opens an existing large object, based on its OID. This method * assumes that READ and WRITE access is required (the default). * * @param oid of large object * @return LargeObject instance providing access to the object * @exception SQLException on error */ public LargeObject open(long oid) throws SQLException { return open(oid, READWRITE); }