Package oracle.jdbc
Interface OracleBlob
-
- All Superinterfaces:
java.sql.Blob
- All Known Implementing Classes:
BLOB
public interface OracleBlob extends java.sql.BlobThis interface defines the Oracle extensions to the standard JDBC interfaceBlob.Generally any new code should avoid the direct use of the class
BLOB. For variable declarations use the interfaceBlobor this interface as required. Instead of the static methodsBLOB.createTemporary(java.sql.Connection, boolean, int)andBLOB.empty_lob()please useConnection.createBlob()andBLOB.getEmptyBLOB()respectively.- Since:
- 11.2.0.3
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Close a previously opened BLOB.java.io.InputStreamgetBinaryStream(long pos)Read from the BLOB as a stream at the requested position.intgetBytes(long pos, int length, byte[] buf)Oracle extension.booleanisEmptyLob()Return true if the lob locator points to an empty blob.booleanisOpen()Check whether the BLOB is opened.booleanisSecureFile()Returnstrueif this is a SecureFile (LOBs with the STORE AS SECUREFILE option, which were introduced in Oracle Database 11g Release 1).booleanisTemporary()Return true if the lob locator points to a temporary blob.voidopen(LargeObjectAccessMode mode)Open a BLOB in the indicated mode.java.sql.SQLXMLtoSQLXML()Returns an object which implements java.sql.SQLXML with content take from this Clob.java.sql.SQLXMLtoSQLXML(int csid)Returns an object which implements java.sql.SQLXML with content taken from this Blob.
-
-
-
Method Detail
-
open
void open(LargeObjectAccessMode mode) throws java.sql.SQLException
Open a BLOB in the indicated mode. Valid modes include MODE_READONLY, and MODE_READWRITE. It is an error to open the same LOB twice.- Throws:
java.sql.SQLException- Since:
- 8.2.0
-
close
void close() throws java.sql.SQLExceptionClose a previously opened BLOB.- Throws:
java.sql.SQLException- Since:
- 8.2.0
-
isOpen
boolean isOpen() throws java.sql.SQLExceptionCheck whether the BLOB is opened.- Returns:
- true if the LOB is opened.
- Throws:
java.sql.SQLException- Since:
- 8.2.0
-
getBytes
int getBytes(long pos, int length, byte[] buf) throws java.sql.SQLExceptionOracle extension. Copy the contents of the BLOB at the requested position to the supplied buffer.- Parameters:
pos- is the first byte of the blob to be extracted.length- is the number of consecutive bytes to be copied.buf- is the buffer to have the extracted bytes.- Returns:
- a byte array containing a portion of the BLOB
- Throws:
java.sql.SQLException
-
isEmptyLob
boolean isEmptyLob() throws java.sql.SQLExceptionReturn true if the lob locator points to an empty blob. False if it does not.- Returns:
- true if the lob locator points to an empty blob. False if it does not.
- Throws:
java.sql.SQLException- Since:
- 8.1.7
-
isSecureFile
boolean isSecureFile() throws java.sql.SQLExceptionReturnstrueif this is a SecureFile (LOBs with the STORE AS SECUREFILE option, which were introduced in Oracle Database 11g Release 1).- Returns:
trueif this is a SecureFile andfalseotherwise.- Throws:
java.sql.SQLException
-
getBinaryStream
java.io.InputStream getBinaryStream(long pos) throws java.sql.SQLExceptionRead from the BLOB as a stream at the requested position.- Parameters:
pos- is the position data to be read.- Returns:
- an input stream to read data from the BLOB
- Throws:
java.sql.SQLException- Since:
- 8.2.0
-
isTemporary
boolean isTemporary() throws java.sql.SQLExceptionReturn true if the lob locator points to a temporary blob. False if it does not.- Returns:
- true if the lob locator points to a temporary blob. False if it does not.
- Throws:
java.sql.SQLException- Since:
- 8.2.0
-
toSQLXML
java.sql.SQLXML toSQLXML() throws java.sql.SQLExceptionReturns an object which implements java.sql.SQLXML with content take from this Clob.- Returns:
- the new SQLXML object
- Throws:
java.sql.SQLException- Since:
- 12.2
-
toSQLXML
java.sql.SQLXML toSQLXML(int csid) throws java.sql.SQLExceptionReturns an object which implements java.sql.SQLXML with content taken from this Blob.- Returns:
- the new SQLXML object
- Throws:
java.sql.SQLException- Since:
- 12.2
-
-