Class BLOB
- java.lang.Object
-
- oracle.sql.Datum
-
- oracle.sql.DatumWithConnection
-
- oracle.sql.BLOB
-
- All Implemented Interfaces:
Serializable
,Blob
,oracle.jdbc.internal.ACProxyable
,oracle.jdbc.internal.OracleBlob
,oracle.jdbc.internal.OracleConcreteProxy
,oracle.jdbc.internal.OracleDatumWithConnection
,oracle.jdbc.internal.OracleLargeObject
,OracleBlob
public class BLOB extends DatumWithConnection implements oracle.jdbc.internal.OracleBlob, oracle.jdbc.internal.OracleConcreteProxy
Deprecated.Use java.sql.Blob interface for declaration instead of using concrete class oracle.sql.BLOB.This class implements the java.sql.Blob interface in JDBC 2.0. It provides the native implementation of the Blob methods. UseBlob
interface for declaration instead of using concrete class oracle.sql.BLOB. java.sql.Blob has methods declared for all opertions. For Oracle specific methods use the interfaceOracleBlob
.Obtaining Blob from ResultSet
java.sql.Blob blob = resultSet.getBlob(...);
Creating temporary Blob from factory method,
Connection
java.sql.Blob blob = connection.createBlob();
- See Also:
Blob
,OracleBlob
,Connection.createBlob()
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
DURATION_CALL
Deprecated.static int
DURATION_INVALID
Deprecated.static int
DURATION_SESSION
Deprecated.static int
MAX_CHUNK_SIZE
Deprecated.1907584: Changed MAX_CHUNK_SIZE from 32512 to 32768.static int
MODE_READONLY
Deprecated.static int
MODE_READWRITE
Deprecated.static int
OLD_WRONG_DURATION_CALL
Deprecated.static int
OLD_WRONG_DURATION_SESSION
Deprecated.protected oracle.jdbc.driver.OracleBlob
target
Deprecated.-
Fields inherited from class oracle.sql.DatumWithConnection
targetDatumWithConnection
-
Fields inherited from class oracle.sql.Datum
ojiOracleDatumWithConnection, targetDatum
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
canReadBasicLobDataInLocator()
Deprecated.Can the lob data be read directly from the locator?void
close()
Deprecated.Close a previously opened BLOB.static BLOB
createTemporary(Connection conn, boolean cache, int _duration)
Deprecated.Create a temporary blob.static BLOB
empty_lob()
Deprecated.use getEmptyBLOB insteadvoid
free()
Deprecated.Free the resources the blob holds.Flow.Publisher<Void>
freeAsyncOracle()
Deprecated.Returns aPublisher
that publishes the result of freeing theBlob
object and the resources that it holds.void
freeTemporary()
Deprecated.Free the contents and the locator of the temporary blob.static void
freeTemporary(BLOB temp_lob)
Deprecated.Free the contents and the locator of the temporary blob.OutputStream
getBinaryOutputStream()
Deprecated.This method is deprecated.OutputStream
getBinaryOutputStream(long pos)
Deprecated.This method is deprecated -- use setBinaryStreamInputStream
getBinaryStream()
Deprecated.Implements the Blob interface function.InputStream
getBinaryStream(boolean isInternal)
Deprecated.Implements the Blob interface function.InputStream
getBinaryStream(long pos)
Deprecated.Read from the BLOB as a stream at the requested position.InputStream
getBinaryStream(long pos, long length)
Deprecated.Return a binary stream beginning at the specified position and ofthe specified length.int
getBufferSize()
Deprecated.Oracle extension.byte[]
getBytes(long pos, int length)
Deprecated.Implements the Blob interface function.int
getBytes(long pos, int length, byte[] buf)
Deprecated.Oracle extension.int
getChunkSize()
Deprecated.Oracle extension.short
getDuration()
Deprecated.return the duration of a temporary LOBstatic short
getDuration(BLOB lob)
Deprecated.return the duration of a temporary LOBstatic BLOB
getEmptyBLOB()
Deprecated.Return a empty lob.Connection
getJavaSqlConnection()
Deprecated.Oracle extension Return the java.sql.Connection associated with the receiver.int
getPrefetchedDataSize()
Deprecated.oracle.jdbc.driver.OracleBlob
getTarget()
Deprecated.boolean
isConvertibleTo(Class<?> jClass)
Deprecated.Oracle extension.boolean
isEmptyLob()
Deprecated.Return true if the lob locator points to a empty blob.boolean
isOpen()
Deprecated.Check whether the BLOB is opened.boolean
isSecureFile()
Deprecated.Returnstrue
if this is a SecureFile (LOBs with the STORE AS SECUREFILE option, which were introduced in Oracle Database 11g Release 1).boolean
isTemporary()
Deprecated.Return true if the lob locator points to a temporary blob.static boolean
isTemporary(BLOB lob)
Deprecated.Return true if the lob locator points to a temporary blob.long
length()
Deprecated.Implements the Blob interface function.void
open(int mode)
Deprecated.Open a BLOB in the indicated mode.void
open(LargeObjectAccessMode mode)
Deprecated.Public method using enum instead of intlong
position(byte[] pattern, long start)
Deprecated.Implements the Blob interface function.long
position(Blob pattern, long start)
Deprecated.Implements the Blob interface function.Flow.Publisher<byte[]>
publisherOracle(long position)
Deprecated.Returns aPublisher
that publishes the content of thisBlob
beginning at the specified position.int
putBytes(long pos, byte[] bytes)
Deprecated.This method is deprecated -- use setBytesint
putBytes(long pos, byte[] bytes, int length)
Deprecated.This method is deprecated -- use setBytesOutputStream
setBinaryStream(long pos)
Deprecated.JDBC 3.0 Retrieves a stream that can be used to write to theBLOB
value that thisBlob
object represents.void
setBytes(byte[] locator)
Deprecated.Sets datum value using a byte array.int
setBytes(long pos, byte[] bytes)
Deprecated.JDBC 3.0 Writes the given array of bytes to theBLOB
value that thisBlob
object represents, starting at positionpos
, and returns the number of bytes written.int
setBytes(long pos, byte[] bytes, int offset, int len)
Deprecated.JDBC 3.0 Writes all or part of the givenbyte
array to theBLOB
value that thisBlob
object represents and returns the number of bytes written.Flow.Subscriber<byte[]>
subscriberOracle(long position)
Deprecated.Returns aSubscriber
that will append the published bytes to thisBlob
beginning at the specified position.Flow.Subscriber<byte[]>
subscriberOracle(long position, Flow.Subscriber<Long> outcomeSubscriber)
Deprecated.Returns aSubscriber
that will append the published bytes to thisBlob
beginning at the specified position.Object
toJdbc()
Deprecated.Oracle extension.SQLXML
toSQLXML()
Deprecated.Returns an object which impements java.sql.SQLXML with content take from this Clob.SQLXML
toSQLXML(int csid)
Deprecated.Returns an object which impements java.sql.SQLXML with content taken from this Blob.void
trim(long newlen)
Deprecated.This method id deprecated -- use truncatevoid
truncate(long len)
Deprecated.JDBC 3.0 Truncates theBLOB
value that thisBlob
object represents to belen
bytes in length.-
Methods inherited from class oracle.sql.DatumWithConnection
assertNotNull, assertNotNull, getConnection, getConnectionDuringExceptionHandling, getOracleConnection
-
Methods inherited from class oracle.sql.Datum
bigDecimalValue, booleanValue, bytesEqual, bytesHashCode, byteValue, compareBytes, dateValue, doubleValue, equals, floatValue, getBytes, getLength, getStream, intValue, isNull, longValue, setShareBytes, shareBytes, stringValue, stringValue, timestampValue, timestampValue, timeValue, timeValue, toClass
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface oracle.jdbc.internal.OracleDatumWithConnection
bigDecimalValue, booleanValue, byteValue, dateValue, doubleValue, floatValue, getBytes, getConnection, getInternalConnection, getLength, getOracleConnection, getStream, intValue, longValue, setPhysicalConnectionOf, setShareBytes, shareBytes, stringValue, stringValue, timestampValue, timestampValue, timeValue, timeValue
-
-
-
-
Field Detail
-
MAX_CHUNK_SIZE
public static final int MAX_CHUNK_SIZE
Deprecated.1907584: Changed MAX_CHUNK_SIZE from 32512 to 32768. This was done to accommodate larger DB_BLOCK_SIZEs. Using 32512 would cause getBufferSize() to return 32512 for DB_BLOCK_SIZEs from 8192-32768. For these block sizes getBufferSize() should return getChunkSize(); not 32512. By using 32768 as the MAX_CHUNK_SIZE, getBufferSize() returns the correct chunk size. Please see bug for details.- See Also:
- Constant Field Values
-
DURATION_INVALID
public static final int DURATION_INVALID
Deprecated.- See Also:
- Constant Field Values
-
DURATION_SESSION
public static final int DURATION_SESSION
Deprecated.- See Also:
- Constant Field Values
-
DURATION_CALL
public static final int DURATION_CALL
Deprecated.- See Also:
- Constant Field Values
-
OLD_WRONG_DURATION_SESSION
public static final int OLD_WRONG_DURATION_SESSION
Deprecated.- See Also:
- Constant Field Values
-
OLD_WRONG_DURATION_CALL
public static final int OLD_WRONG_DURATION_CALL
Deprecated.- See Also:
- Constant Field Values
-
MODE_READONLY
public static final int MODE_READONLY
Deprecated.- See Also:
- Constant Field Values
-
MODE_READWRITE
public static final int MODE_READWRITE
Deprecated.- See Also:
- Constant Field Values
-
target
protected oracle.jdbc.driver.OracleBlob target
Deprecated.
-
-
Method Detail
-
getTarget
public oracle.jdbc.driver.OracleBlob getTarget()
Deprecated.
-
length
public long length() throws SQLException
Deprecated.Implements the Blob interface function. Return the length of the Binary Large OBject in bytes.- Specified by:
length
in interfaceBlob
- Returns:
- length of the BLOB in bytes
- Throws:
SQLException
-
publisherOracle
public final Flow.Publisher<byte[]> publisherOracle(long position) throws SQLException
Deprecated.Description copied from interface:OracleBlob
Returns aPublisher
that publishes the content of thisBlob
beginning at the specified position. The argument to each call toSubscriber.onNext
will contain an implementation defined number of bytes.Calling any method of this
Blob
exceptisEmptyLob()
,isSecureFile()
,isTemporary()
, or one defined byObject
between 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.Asynchronous tasks initiated by this method will execute under the current
AccessControlContext
of the calling thread.- Specified by:
publisherOracle
in interfaceOracleBlob
- Parameters:
position
- the position at which to start reading from the BLOB value that thisBlob
object represents; The first position is 1- Returns:
- a
Publisher
of the content of thisBlob
- Throws:
SQLException
- if a database error occurs, or if this method is called on aBlob
that has been freed, or ifposition
is less than 1
-
subscriberOracle
public final Flow.Subscriber<byte[]> subscriberOracle(long position) throws SQLException
Deprecated.Description copied from interface:OracleBlob
Returns aSubscriber
that will append the published bytes to thisBlob
beginning at the specified position.Calling any method of this
Blob
exceptisEmptyLob()
,isSecureFile()
,isTemporary()
, or one defined byObject
between the time this method is called and the time when the returnedSubscriber
terminates will block.The returned
Subscriber
terminates onceSubscriber.onComplete
is received,Subscriber.onError
is received, or its subscription is cancelled.Asynchronous tasks initiated by this method will execute under the current
AccessControlContext
of the calling thread.- Specified by:
subscriberOracle
in interfaceOracleBlob
- Parameters:
position
- the position at which to start reading from the BLOB value that thisBlob
object represents; The first position is 1- Returns:
- a
Subscriber
that appends bytes to thisBlob
- Throws:
SQLException
- if a database error occurs, or if this method is called on aBlob
that has been freed, or ifposition
is less than 1
-
subscriberOracle
public final Flow.Subscriber<byte[]> subscriberOracle(long position, Flow.Subscriber<Long> outcomeSubscriber) throws SQLException
Deprecated.Description copied from interface:OracleBlob
Returns aSubscriber
that will append the published bytes to thisBlob
beginning at the specified position.Calling any method of this
Blob
exceptisEmptyLob()
,isSecureFile()
,isTemporary()
, or one defined byObject
between the time this method is called and the time when the returnedSubscriber
terminates will block.The returned
Subscriber
terminates onceSubscriber.onComplete
is received,Subscriber.onError
is 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
outcomeSubscriber
receives anonNext
signal 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
outcomeSubscriber
receives anonComplete
signal after the last published byte has been written successfully. - The
outcomeSubscriber
receives anonError
signal with aSQLException
if a failure occurs when writing published bytes.
The
outcomeSubscriber
must 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 theoutcomeSubscriber
has 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
.Asynchronous tasks initiated by this method will execute under the current
AccessControlContext
of the calling thread.- Specified by:
subscriberOracle
in interfaceOracleBlob
- Parameters:
position
- the position at which to start reading from the BLOB value that thisBlob
object represents; The first position is 1outcomeSubscriber
- aSubscriber
of write outcomes.- Returns:
- a
Subscriber
that appends bytes to thisBlob
- Throws:
SQLException
- if a database error occurs, or if this method is called on aBlob
that has been freed, or ifposition
is less than 1
- The
-
freeAsyncOracle
public final Flow.Publisher<Void> freeAsyncOracle() throws SQLException
Deprecated.Returns aPublisher
that publishes the result of freeing theBlob
object and the resources that it holds. The object is invalid after the returnedPublisher
terminates withonComplete
.After the returned
Publisher
terminates withonComplete
, any attempt to invoke a method other thanBlob.free()
orfreeAsyncOracle
will result in an SQLException being thrown. CallingfreeAsyncOracle
on aBlob
object that has already been freed is treated as a no-op.Calling any method of this
Blob
exceptisEmptyLob()
,isSecureFile()
,isTemporary()
, or one defined byObject
between the time this method is called and the time when the returnedSubscriber
terminates 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
onComplete
oronError
; No items are emitted toonNext
.Asynchronous tasks initiated by this method will execute under the current
AccessControlContext
of the calling thread.Implements the Reactive Extensions API by delegating to the
ojiOracleBlob
's implemenation.- Specified by:
freeAsyncOracle
in interfaceOracleBlob
- Returns:
- a
Publisher
of the result of freeing thisBlob
- Throws:
SQLException
- if a database error occurs
-
getBytes
public byte[] getBytes(long pos, int length) throws SQLException
Deprecated.Implements the Blob interface function. Return a copy of the contents of the BLOB at the requested position.- Specified by:
getBytes
in interfaceBlob
- Parameters:
pos
- is the first byte of the blob to be extracted.length
- is the number of consecutive bytes to be copied.- Returns:
- a byte array containing a portion of the BLOB If the
pos
argument is larger than the length of the data the result is null. If thepos
argument is less than the length of the data, but the sum ofpos
argument and thelength
is greater than the length of the data, the result will be smaller than the length requested. If thelength
is zero return and empty array - Throws:
SQLException
-
getBinaryStream
public InputStream getBinaryStream() throws SQLException
Deprecated.Implements the Blob interface function. Retrieve the entire BLOB as a stream.- Specified by:
getBinaryStream
in interfaceBlob
- Returns:
- a stream containing the BLOB data
- Throws:
SQLException
-
getBinaryStream
public InputStream getBinaryStream(boolean isInternal) throws SQLException
Deprecated.Implements the Blob interface function. Retrieve the entire BLOB as a stream.- Returns:
- a stream containing the BLOB data
- Throws:
SQLException
-
position
public long position(byte[] pattern, long start) throws SQLException
Deprecated.Implements the Blob interface function. Determine the byte position at which the given byte pattern- Specified by:
position
in interfaceBlob
- Parameters:
pattern
- is the pattern to search for.start
- is the position at which to begin searching.- Returns:
- the position at which the pattern appears, else -1.
- Throws:
SQLException
-
position
public long position(Blob pattern, long start) throws SQLException
Deprecated.Implements the Blob interface function. Determine the byte position at which the given pattern- Specified by:
position
in interfaceBlob
- Parameters:
pattern
- is the pattern to search for.start
- is the position at which to begin searching.- Returns:
- the position at which the pattern appears, else -1.
- Throws:
SQLException
-
getBytes
public int getBytes(long pos, int length, byte[] buf) throws SQLException
Deprecated.Oracle extension. Copy the contents of the BLOB at the requested position to suppied buffer.- Specified by:
getBytes
in interfaceOracleBlob
- 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 had the extracted bytes.- Returns:
- a byte array containing a portion of the BLOB
- Throws:
SQLException
-
putBytes
public int putBytes(long pos, byte[] bytes) throws SQLException
Deprecated.This method is deprecated -- use setBytesOracle extension. Put data to the BLOB at the requested position.- Specified by:
putBytes
in interfaceoracle.jdbc.internal.OracleBlob
- Parameters:
pos
- is the position data to be put.bytes
- is the data to be written into BLOB.- Returns:
- the number of bytes actually written.
- Throws:
SQLException
-
putBytes
public int putBytes(long pos, byte[] bytes, int length) throws SQLException
Deprecated.This method is deprecated -- use setBytesOracle extension. Put data to the BLOB at the requested position.- Specified by:
putBytes
in interfaceoracle.jdbc.internal.OracleBlob
- Parameters:
pos
- is the position data to be put.bytes
- is the data to be written into BLOB.length
- is the length of the data to be written into BLOB.- Returns:
- the number of bytes actually written.
- Throws:
SQLException
-
getBinaryOutputStream
public OutputStream getBinaryOutputStream() throws SQLException
Deprecated.This method is deprecated. Use setBinaryStream(1L).Oracle extension. Write to the BLOB from a stream.- Specified by:
getBinaryOutputStream
in interfaceoracle.jdbc.internal.OracleBlob
- Returns:
- a output stream to write data to the BLOB
- Throws:
SQLException
-
getChunkSize
public int getChunkSize() throws SQLException
Deprecated.Oracle extension. Get database LOB storage chunk size in database.- Specified by:
getChunkSize
in interfaceoracle.jdbc.internal.OracleBlob
- Returns:
- size in bytes
- Throws:
SQLException
-
getBufferSize
public int getBufferSize() throws SQLException
Deprecated.Oracle extension. Get ideal LOB db access buffer size.- Specified by:
getBufferSize
in interfaceoracle.jdbc.internal.OracleBlob
- Returns:
- size in bytes
- Throws:
SQLException
-
empty_lob
public static BLOB empty_lob() throws SQLException
Deprecated.use getEmptyBLOB insteadReturn a empty lob. An empty lob is used initialize a LOB column/attribute. Note: an empty lob can not be read or written- Returns:
- a empty lob
- Throws:
SQLException
- Since:
- 8.1.7
-
getEmptyBLOB
public static BLOB getEmptyBLOB() throws SQLException
Deprecated.Return a empty lob. An empty lob is used initialize a BLOB column/attribute. Note: an empty lob can not be read or written- Returns:
- a empty lob
- Throws:
SQLException
- Since:
- 10.2
-
isEmptyLob
public boolean isEmptyLob() throws SQLException
Deprecated.Return true if the lob locator points to a empty blob. False if it does not. This method supports only Blobs that are not returned from the database. For Blobs returned from the database, use length(), i.e. check for zero length.- Specified by:
isEmptyLob
in interfaceOracleBlob
- Returns:
- true if the lob locator points to a empty blob. False if it does not.
- Throws:
SQLException
- Since:
- 8.1.7
-
isSecureFile
public boolean isSecureFile() throws SQLException
Deprecated.Returnstrue
if this is a SecureFile (LOBs with the STORE AS SECUREFILE option, which were introduced in Oracle Database 11g Release 1).- Specified by:
isSecureFile
in interfaceOracleBlob
- Returns:
true
if this is a SecureFile andfalse
otherwise.- Throws:
SQLException
-
getBinaryOutputStream
public OutputStream getBinaryOutputStream(long pos) throws SQLException
Deprecated.This method is deprecated -- use setBinaryStreamWrite to the BLOB from a stream at the requested position.- Specified by:
getBinaryOutputStream
in interfaceoracle.jdbc.internal.OracleBlob
- Parameters:
pos
- is the position data to be put.- Returns:
- a output stream to write data to the BLOB
- Throws:
SQLException
- Since:
- 8.2.0
-
getBinaryStream
public InputStream getBinaryStream(long pos) throws SQLException
Deprecated.Read from the BLOB as a stream at the requested position.- Specified by:
getBinaryStream
in interfaceOracleBlob
- Parameters:
pos
- is the position data to be read, should be greater than 0.- Returns:
- a input stream to read data from the BLOB
- Throws:
SQLException
- Since:
- 8.2.0
-
trim
public void trim(long newlen) throws SQLException
Deprecated.This method id deprecated -- use truncateTrim the value of the BLOB to the length you specify in the newlen parameter.- Specified by:
trim
in interfaceoracle.jdbc.internal.OracleBlob
- Parameters:
newlen
- the new length of the BLOB.- Throws:
SQLException
- Since:
- 8.2.0
-
createTemporary
public static BLOB createTemporary(Connection conn, boolean cache, int _duration) throws SQLException
Deprecated.Create a temporary blob.- Parameters:
cache
- Specifies if LOB should be read into buffer cache or not._duration
- The duration of the temporary LOB. The following are valid values: DURATION_SESSION, DURATION_CALL.- Returns:
- A temporary blob.
- Throws:
SQLException
- Since:
- 8.2.0
-
freeTemporary
public static void freeTemporary(BLOB temp_lob) throws SQLException
Deprecated.Free the contents and the locator of the temporary blob.- Parameters:
temp_lob
- A temporary blob to be freeed.- Throws:
SQLException
- if temp_lob is a permanent lob or temp_lob has already been freed.- Since:
- 8.2.0
-
isTemporary
public static boolean isTemporary(BLOB lob) throws SQLException
Deprecated.Return true if the lob locator points to a temporary blob. False if it does not.- Parameters:
lob
- the blob to test.- Returns:
- true if the lob locator points to a temporary blob. False if it does not.
- Throws:
SQLException
- Since:
- 8.2.0
-
getDuration
public static short getDuration(BLOB lob) throws SQLException
Deprecated.return the duration of a temporary LOB- Returns:
- the duration of a temporary LOB
- Throws:
SQLException
- Since:
- 18.1
-
freeTemporary
public void freeTemporary() throws SQLException
Deprecated.Free the contents and the locator of the temporary blob.- Specified by:
freeTemporary
in interfaceoracle.jdbc.internal.OracleLargeObject
- Throws:
SQLException
- if self is a permanent lob or self has already been freed.- Since:
- 8.2.0
-
isTemporary
public boolean isTemporary() throws SQLException
Deprecated.Return true if the lob locator points to a temporary blob. False if it does not.- Specified by:
isTemporary
in interfaceOracleBlob
- Specified by:
isTemporary
in interfaceoracle.jdbc.internal.OracleLargeObject
- Returns:
- true if the lob locator points to a temporary blob. False if it does not.
- Throws:
SQLException
- Since:
- 8.2.0
-
getDuration
public short getDuration() throws SQLException
Deprecated.return the duration of a temporary LOB- Specified by:
getDuration
in interfaceoracle.jdbc.internal.OracleLargeObject
- Returns:
- the duration of a temporary LOB
- Throws:
SQLException
- Since:
- 18.1
-
open
public void open(LargeObjectAccessMode mode) throws SQLException
Deprecated.Public method using enum instead of int- Specified by:
open
in interfaceOracleBlob
- Throws:
SQLException
-
open
public void open(int mode) throws SQLException
Deprecated.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:
SQLException
- Since:
- 8.2.0
-
close
public void close() throws SQLException
Deprecated.Close a previously opened BLOB.- Specified by:
close
in interfaceOracleBlob
- Throws:
SQLException
- Since:
- 8.2.0
-
isOpen
public boolean isOpen() throws SQLException
Deprecated.Check whether the BLOB is opened.- Specified by:
isOpen
in interfaceOracleBlob
- Returns:
- true if the LOB is opened.
- Throws:
SQLException
- Since:
- 8.2.0
-
setBytes
public int setBytes(long pos, byte[] bytes) throws SQLException
Deprecated.JDBC 3.0 Writes the given array of bytes to theBLOB
value that thisBlob
object represents, starting at positionpos
, and returns the number of bytes written.- Specified by:
setBytes
in interfaceBlob
- Parameters:
pos
- the position in theBLOB
object at which to start writingbytes
- the array of bytes to be written to theBLOB
value that thisBlob
object represents- Returns:
- the number of bytes written
- Throws:
SQLException
- if there is an error accessing theBLOB
value- Since:
- 9.0.2
-
setBytes
public int setBytes(long pos, byte[] bytes, int offset, int len) throws SQLException
Deprecated.JDBC 3.0 Writes all or part of the givenbyte
array to theBLOB
value that thisBlob
object represents and returns the number of bytes written. Writing starts at positionpos
in theBLOB
value;len
bytes from the given byte array are written.- Specified by:
setBytes
in interfaceBlob
- Parameters:
pos
- the position in theBLOB
object at which to start writingbytes
- the array of bytes to be written to thisBLOB
objectoffset
- the offset into the arraybytes
at which to start reading the bytes to be setlen
- the number of bytes to be written to theBLOB
value from the array of bytesbytes
- Returns:
- the number of bytes written
- Throws:
SQLException
- if there is an error accessing theBLOB
value- Since:
- 9.0.2
-
setBinaryStream
public OutputStream setBinaryStream(long pos) throws SQLException
Deprecated.JDBC 3.0 Retrieves a stream that can be used to write to theBLOB
value that thisBlob
object represents. The stream begins at positionpos
.- Specified by:
setBinaryStream
in interfaceBlob
- Parameters:
pos
- the position in theBLOB
value at which to start writing- Returns:
- a
java.io.OutputStream
object to which data can be written - Throws:
SQLException
- if there is an error accessing theBLOB
value- Since:
- 9.0.2
- See Also:
getBinaryStream()
-
truncate
public void truncate(long len) throws SQLException
Deprecated.JDBC 3.0 Truncates theBLOB
value that thisBlob
object represents to belen
bytes in length.- Specified by:
truncate
in interfaceBlob
- Parameters:
len
- the length, in bytes, to which theBLOB
value that thisBlob
object represents should be truncated- Throws:
SQLException
- if there is an error accessing theBLOB
value- Since:
- 9.0.2
-
toJdbc
public Object toJdbc() throws SQLException
Deprecated.Oracle extension. Convert this data object into its default Java object type.- Specified by:
toJdbc
in interfaceoracle.jdbc.internal.OracleBlob
- Specified by:
toJdbc
in interfaceoracle.jdbc.internal.OracleDatumWithConnection
- Specified by:
toJdbc
in classDatum
- Returns:
- this object.
- Throws:
SQLException
- if any of the lower layer code throws an exception.
-
isConvertibleTo
public boolean isConvertibleTo(Class<?> jClass)
Deprecated.Oracle extension. Test whether this data object can be converted to the specified Java data type.- Specified by:
isConvertibleTo
in interfaceoracle.jdbc.internal.OracleBlob
- Specified by:
isConvertibleTo
in interfaceoracle.jdbc.internal.OracleDatumWithConnection
- Specified by:
isConvertibleTo
in classDatum
- Parameters:
jClass
- specifies the Java data type to test against.- Returns:
- true if this data object is convertible to the specified Java class, and a corresponding xxxValue() method is available; otherwise, a false is returned.
-
getJavaSqlConnection
public Connection getJavaSqlConnection() throws SQLException
Deprecated.Description copied from class:DatumWithConnection
Oracle extension Return the java.sql.Connection associated with the receiver. Since 9.0.0 not all Oracle JDBC connection objects are assignment compatible with oracle.jdbc.driver.OracleConnection. If the connection is wrapped, return the outermost wrapper.- Specified by:
getJavaSqlConnection
in interfaceoracle.jdbc.internal.OracleBlob
- Specified by:
getJavaSqlConnection
in interfaceoracle.jdbc.internal.OracleDatumWithConnection
- Overrides:
getJavaSqlConnection
in classDatumWithConnection
- Returns:
- the connection
- Throws:
SQLException
- if an error occurs
-
getPrefetchedDataSize
public final int getPrefetchedDataSize()
Deprecated.- Specified by:
getPrefetchedDataSize
in interfaceoracle.jdbc.internal.OracleBlob
-
canReadBasicLobDataInLocator
public boolean canReadBasicLobDataInLocator() throws SQLException
Deprecated.Can the lob data be read directly from the locator?- Specified by:
canReadBasicLobDataInLocator
in interfaceoracle.jdbc.internal.OracleBlob
- Returns:
- True if we can; false otherwise.
- Throws:
SQLException
-
free
public void free() throws SQLException
Deprecated.Free the resources the blob holds.- Specified by:
free
in interfaceBlob
- Throws:
SQLException
- Since:
- 11.0
-
getBinaryStream
public InputStream getBinaryStream(long pos, long length) throws SQLException
Deprecated.Return a binary stream beginning at the specified position and ofthe specified length.- Specified by:
getBinaryStream
in interfaceBlob
- Parameters:
pos
- start positionlength
- number of bytes in the result- Throws:
SQLException
- if pos is less than 1 or if pos is greater than the number of bytes in the Blob or if pos + length is greater than the number of bytes in the Blob.- Since:
- 11.0
-
setBytes
public void setBytes(byte[] locator)
Deprecated.Description copied from class:Datum
Sets datum value using a byte array. The byte array is copied.
-
toSQLXML
public SQLXML toSQLXML() throws SQLException
Deprecated.Returns an object which impements java.sql.SQLXML with content take from this Clob.- Specified by:
toSQLXML
in interfaceOracleBlob
- Returns:
- the new SQLXML object
- Throws:
SQLException
- Since:
- 12.2
-
toSQLXML
public SQLXML toSQLXML(int csid) throws SQLException
Deprecated.Returns an object which impements java.sql.SQLXML with content taken from this Blob.- Specified by:
toSQLXML
in interfaceOracleBlob
- Returns:
- the new SQLXML object
- Throws:
SQLException
- Since:
- 12.2
-
-