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 Default Methods Deprecated Methods Modifier and Type Method Description default voidclose()Deprecated, for removal: This API element is subject to removal in a future version.The name of this method is anticipated to conflict with a future version of the JDBC Specification.voidcloseLob()Close a previously opened BLOB.default java.util.concurrent.Flow.Publisher<java.lang.Void>freeAsyncOracle()Returns aPublisherthat publishes the result of freeing theBlobobject and the resources that it holds.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.default booleanisOpen()Deprecated, for removal: This API element is subject to removal in a future version.The name of this method is anticipated to conflict with a future version of the JDBC Specification.booleanisOpenLob()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.default voidopen(LargeObjectAccessMode mode)Deprecated, for removal: This API element is subject to removal in a future version.The name of this method is anticipated to conflict with a future version of the JDBC Specification.voidopenLob(LargeObjectAccessMode mode)Open a BLOB in the indicated mode.java.util.concurrent.Flow.Publisher<byte[]>publisherOracle(long position)Returns aPublisherthat publishes the content of thisBlobbeginning at the specified position.default java.util.concurrent.Flow.Publisher<byte[]>publisherOracle(long position, ErrorSet continueOnErrorSet)Returns aPublisherthat publishes the content of thisBlobbeginning at the specified position.java.util.concurrent.Flow.Subscriber<byte[]>subscriberOracle(long position)Returns aSubscriberthat will append the published bytes to thisBlobbeginning at the specified position.java.util.concurrent.Flow.Subscriber<byte[]>subscriberOracle(long position, java.util.concurrent.Flow.Subscriber<java.lang.Long> outcomeSubscriber)Returns aSubscriberthat will append the published bytes to thisBlobbeginning at the specified position.default java.util.concurrent.Flow.Subscriber<byte[]>subscriberOracle(long position, java.util.concurrent.Flow.Subscriber<java.lang.Long> outcomeSubscriber, ErrorSet continueOnErrorSet)Returns aSubscriberthat will append the published bytes to thisBlobbeginning at the specified position.default java.util.concurrent.Flow.Subscriber<byte[]>subscriberOracle(long position, ErrorSet continueOnErrorSet)Returns aSubscriberthat will append the published bytes to thisBlobbeginning at the specified position.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
@Deprecated(since="23.5", forRemoval=true) default void open(LargeObjectAccessMode mode) throws java.sql.SQLExceptionDeprecated, for removal: This API element is subject to removal in a future version.The name of this method is anticipated to conflict with a future version of the JDBC Specification. This method will be removed in a future version of the Oracle JDBC Driver. Any calls to this method should be replaced with a call toopenLob(LargeObjectAccessMode), which provides the exact same behavior.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
-
openLob
void openLob(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:
- 23.5
-
close
@Deprecated(since="23.5", forRemoval=true) default void close() throws java.sql.SQLExceptionDeprecated, for removal: This API element is subject to removal in a future version.The name of this method is anticipated to conflict with a future version of the JDBC Specification. This method will be removed in a future version of the Oracle JDBC Driver. Any calls to this method should be replaced with a call tocloseLob(), which provides the exact same behavior.Close a previously opened BLOB.- Throws:
java.sql.SQLException- Since:
- 8.2.0
-
closeLob
void closeLob() throws java.sql.SQLExceptionClose a previously opened BLOB.- Throws:
java.sql.SQLException- Since:
- 23.5
-
isOpen
@Deprecated(since="23.5", forRemoval=true) default boolean isOpen() throws java.sql.SQLExceptionDeprecated, for removal: This API element is subject to removal in a future version.The name of this method is anticipated to conflict with a future version of the JDBC Specification. This method will be removed in a future version of the Oracle JDBC Driver. Any calls to this method should be replaced with a call toisOpenLob(), which provides the exact same behavior.Check whether the BLOB is opened.- Returns:
- true if the LOB is opened.
- Throws:
java.sql.SQLException- Since:
- 8.2.0
-
isOpenLob
boolean isOpenLob() throws java.sql.SQLExceptionCheck whether the BLOB is opened.- Returns:
- true if the LOB is opened.
- Throws:
java.sql.SQLException- Since:
- 23.5
-
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
-
publisherOracle
java.util.concurrent.Flow.Publisher<byte[]> publisherOracle(long position) throws java.sql.SQLExceptionReturns aPublisherthat publishes the content of thisBlobbeginning at the specified position. The argument to each call toSubscriber.onNextwill contain an implementation defined number of bytes.Calling any method of this
BlobexceptisEmptyLob(),isSecureFile(),isTemporary(), or one defined byObjectbetween the time this method is called and the time when the returned publisher terminates will block.The returned publisher terminates once all subscribers have received
Subscriber.onComplete, receivedSubscriber.onError, or cancelled their subscription.An invocation of this method is equivalent to invoking
publisherOracle(long, ErrorSet)with theErrorSetconfigured byOracleCommonConnection.continueOnError(ErrorSet).- Parameters:
position- the position at which to start reading from the BLOB value that thisBlobobject represents; The first position is 1- Returns:
- a
Publisherof the content of thisBlob - Throws:
java.sql.SQLException- if a database error occurs, or if this method is called on aBlobthat has been freed, or ifpositionis less than 1- Since:
- 21
-
publisherOracle
default java.util.concurrent.Flow.Publisher<byte[]> publisherOracle(long position, ErrorSet continueOnErrorSet) throws java.sql.SQLExceptionReturns aPublisherthat publishes the content of thisBlobbeginning at the specified position. The argument to each call toSubscriber.onNextwill contain an implementation defined number of bytes.Calling any method of this
BlobexceptisEmptyLob(),isSecureFile(),isTemporary(), or one defined byObjectbetween the time this method is called and the time when the returned publisher terminates will block.The returned publisher terminates once all subscribers have received
Subscriber.onComplete, receivedSubscriber.onError, or cancelled their subscription.Upon signalling demand to the returned
Publisher, LOB read operations will enter into the execution pipeline of this LOB's connection. If an operation fails with an error not in thecontinueOnErrorSet, the pipeline will abort all subsequent asynchronous operations, up to the next#resume().- Parameters:
position- the position at which to start reading from the BLOB value that thisBlobobject represents; The first position is 1continueOnErrorSet- Set of errors which do not cause subsequent operations to be aborted. Not null.- Returns:
- a
Publisherof the content of thisBlob - Throws:
java.sql.SQLException- if a database error occurs, or if this method is called on aBlobthat has been freed, or ifpositionis less than 1java.lang.NullPointerException- if thecontinueOnErrorSetis nulljava.lang.IllegalArgumentException- if thecontinueOnErrorSetis not supported. At a minimum, all drivers must supportErrorSet.NO_ERRORSandErrorSet.ALL_ERRORS- Since:
- 23
-
subscriberOracle
java.util.concurrent.Flow.Subscriber<byte[]> subscriberOracle(long position) throws java.sql.SQLExceptionReturns aSubscriberthat will append the published bytes to thisBlobbeginning at the specified position.Calling any method of this
BlobexceptisEmptyLob(),isSecureFile(),isTemporary(), or one defined byObjectbetween the time this method is called and the time when the returnedSubscriberterminates will block.The returned
Subscriberterminates onceSubscriber.onCompleteis received,Subscriber.onErroris received, or its subscription is cancelled.An invocation of this method is equivalent to invoking
subscriberOracle(long, ErrorSet)with theErrorSetconfigured byOracleCommonConnection.continueOnError(ErrorSet).- Parameters:
position- the position at which to start reading from the BLOB value that thisBlobobject represents; The first position is 1- Returns:
- a
Subscriberthat appends bytes to thisBlob - Throws:
java.sql.SQLException- if a database error occurs, or if this method is called on aBlobthat has been freed, or ifpositionis less than 1- Since:
- 21
-
subscriberOracle
default java.util.concurrent.Flow.Subscriber<byte[]> subscriberOracle(long position, ErrorSet continueOnErrorSet) throws java.sql.SQLExceptionReturns aSubscriberthat will append the published bytes to thisBlobbeginning at the specified position.Calling any method of this
BlobexceptisEmptyLob(),isSecureFile(),isTemporary(), or one defined byObjectbetween the time this method is called and the time when the returnedSubscriberterminates will block.The returned
Subscriberterminates onceSubscriber.onCompleteis received,Subscriber.onErroris received, or its subscription is cancelled.Upon receiving bytes from an upstream
Publisher, LOB write operations will enter into the execution pipeline of this LOB's connection. If an operation fails with an error not in thecontinueOnErrorSet, the pipeline will abort all subsequent asynchronous operations, up to the next#resume().- Parameters:
position- the position at which to start reading from the BLOB value that thisBlobobject represents; The first position is 1continueOnErrorSet- Set of errors which do not cause subsequent operations to be aborted. Not null.- Returns:
- a
Subscriberthat appends bytes to thisBlob - Throws:
java.sql.SQLException- if a database error occurs, or if this method is called on aBlobthat has been freed, or ifpositionis less than 1- Since:
- 21
-
subscriberOracle
java.util.concurrent.Flow.Subscriber<byte[]> subscriberOracle(long position, java.util.concurrent.Flow.Subscriber<java.lang.Long> outcomeSubscriber) throws java.sql.SQLExceptionReturns aSubscriberthat will append the published bytes to thisBlobbeginning at the specified position.Calling any method of this
BlobexceptisEmptyLob(),isSecureFile(),isTemporary(), or one defined byObjectbetween the time this method is called and the time when the returnedSubscriberterminates will block.The returned
Subscriberterminates onceSubscriber.onCompleteis received,Subscriber.onErroris received, or its subscription is cancelled.The outcome of writing published bytes to the BLOB value that this Blob object represents is published to the
outcomeSubscriber:-
The
outcomeSubscriberreceives anonNextsignal each time a write to the BLOB value is successful. The number of bytes transferred in each successful write is the argument to each invocation ofonNext. -
The
outcomeSubscriberreceives anonCompletesignal after the last published byte has been written successfully. -
The
outcomeSubscriberreceives anonErrorsignal with aSQLExceptionif a failure occurs when writing published bytes.
The
outcomeSubscribermust signal demand in order to receive any of the signals listed above. If more thanFlow.defaultBufferSize()writes have succeeded without demand from theoutcomeSubscriber, then the returned subscriber will not signal further demand until theoutcomeSubscriberhas also signalled demand.The number of writes used to transfer published bytes to the BLOB value is implementation defined, and may be different from the number of byte arrays published to the returned
Subscriber.An invocation of this method is equivalent to invoking
subscriberOracle(long, Subscriber, ErrorSet)with theErrorSetconfigured byOracleCommonConnection.continueOnError(ErrorSet).- Parameters:
position- the position at which to start reading from the BLOB value that thisBlobobject represents; The first position is 1outcomeSubscriber- aSubscriberof write outcomes.- Returns:
- a
Subscriberthat appends bytes to thisBlob - Throws:
java.sql.SQLException- if a database error occurs, or if this method is called on aBlobthat has been freed, or ifpositionis less than 1java.lang.NullPointerException- if theoutcomeSubscriberargument is null.- Since:
- 21
-
The
-
subscriberOracle
default java.util.concurrent.Flow.Subscriber<byte[]> subscriberOracle(long position, java.util.concurrent.Flow.Subscriber<java.lang.Long> outcomeSubscriber, ErrorSet continueOnErrorSet) throws java.sql.SQLExceptionReturns aSubscriberthat will append the published bytes to thisBlobbeginning at the specified position.Calling any method of this
BlobexceptisEmptyLob(),isSecureFile(),isTemporary(), or one defined byObjectbetween the time this method is called and the time when the returnedSubscriberterminates will block.The returned
Subscriberterminates onceSubscriber.onCompleteis received,Subscriber.onErroris received, or its subscription is cancelled.The outcome of writing published bytes to the BLOB value that this Blob object represents is published to the
outcomeSubscriber:-
The
outcomeSubscriberreceives anonNextsignal each time a write to the BLOB value is successful. The number of bytes transferred in each successful write is the argument to each invocation ofonNext. -
The
outcomeSubscriberreceives anonCompletesignal after the last published byte has been written successfully. -
The
outcomeSubscriberreceives anonErrorsignal with aSQLExceptionif a failure occurs when writing published bytes.
The
outcomeSubscribermust signal demand in order to receive any of the signals listed above. If more thanFlow.defaultBufferSize()writes have succeeded without demand from theoutcomeSubscriber, then the returned subscriber will not signal further demand until theoutcomeSubscriberhas also signalled demand.The number of writes used to transfer published bytes to the BLOB value is implementation defined, and may be different from the number of byte arrays published to the returned
Subscriber.Upon receiving bytes from an upstream
Publisher, LOB write operations will enter into the execution pipeline of this LOB's connection. If an operation fails with an error not in thecontinueOnErrorSet, the pipeline will abort all subsequent asynchronous operations, up to the next#resume().- Parameters:
position- the position at which to start reading from the BLOB value that thisBlobobject represents; The first position is 1outcomeSubscriber- aSubscriberof write outcomes.continueOnErrorSet- Set of errors which do not cause subsequent operations to be aborted. Not null.- Returns:
- a
Subscriberthat appends bytes to thisBlob - Throws:
java.sql.SQLException- if a database error occurs, or if this method is called on aBlobthat has been freed, or ifpositionis less than 1java.lang.NullPointerException- if theoutcomeSubscriberargument is null.- Since:
- 23
-
The
-
freeAsyncOracle
default java.util.concurrent.Flow.Publisher<java.lang.Void> freeAsyncOracle() throws java.sql.SQLExceptionReturns aPublisherthat publishes the result of freeing theBlobobject and the resources that it holds. The object is invalid after the returnedPublisherterminates withonComplete.After the returned
Publisherterminates withonComplete, any attempt to invoke a method other thanBlob.free()orfreeAsyncOraclewill result in an SQLException being thrown. CallingfreeAsyncOracleon aBlobobject that has already been freed is treated as a no-op.Calling any method of this
BlobexceptisEmptyLob(),isSecureFile(),isTemporary(), or one defined byObjectbetween the time this method is called and the time when the returnedSubscriberterminates will block.The returned publisher terminates once all subscribers have received
Subscriber.onComplete, receivedSubscriber.onError, or cancelled their subscription.The returned publisher will only emit
onCompleteoronError; No items are emitted toonNext.- Returns:
- a
Publisherof the result of freeing thisBlob - Throws:
java.sql.SQLException- if a database error occurs- Since:
- 21
-
-