public class BLOB extends DatumWithConnection implements oracle.jdbc.internal.OracleBlob, oracle.jdbc.internal.OracleConcreteProxy
Blob
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 interface
OracleBlob
.
Obtaining Blob from ResultSet
java.sql.Blob blob = resultSet.getBlob(...);
Creating temporary Blob from factory method, java.sql.Connection#crateBlob()
java.sql.Blob blob = connection.createBlob();
Blob
,
OracleBlob
,
Connection.createBlob()
,
Serialized FormModifier and Type | Field and 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.
|
targetDatumWithConnection
ojiOracleDatumWithConnection, targetDatum
Modifier | Constructor and Description |
---|---|
protected |
BLOB()
Deprecated.
|
protected |
BLOB(oracle.jdbc.driver.OracleBlob b)
Deprecated.
Call from empty lob static method
|
Modifier and Type | Method and Description |
---|---|
boolean |
canReadBasicLobDataInLocator()
Deprecated.
Can the lob data be read directly from the locator?
|
void |
closeLob()
Deprecated.
Close a previously opened BLOB.
|
static BLOB |
createTemporary(java.sql.Connection conn,
boolean cache,
int _duration)
Deprecated.
Create a temporary blob.
|
static BLOB |
empty_lob()
Deprecated.
use getEmptyBLOB instead
|
void |
free()
Deprecated.
Free the resources the blob holds.
|
void |
freeLOB()
Deprecated.
|
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.
|
java.io.OutputStream |
getBinaryOutputStream()
Deprecated.
This method is deprecated. Use setBinaryStream(1L).
|
java.io.OutputStream |
getBinaryOutputStream(long pos)
Deprecated.
This method is deprecated -- use setBinaryStream
|
java.io.InputStream |
getBinaryStream()
Deprecated.
Implements the Blob interface function.
|
java.io.InputStream |
getBinaryStream(boolean isInternal)
Deprecated.
Implements the Blob interface function.
|
java.io.InputStream |
getBinaryStream(long pos)
Deprecated.
Read from the BLOB as a stream at the requested position.
|
java.io.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 LOB
|
static short |
getDuration(BLOB lob)
Deprecated.
return the duration of a temporary LOB
|
static BLOB |
getEmptyBLOB()
Deprecated.
Return a empty lob.
|
java.sql.Connection |
getJavaSqlConnection()
Deprecated.
Oracle extension
Return the java.sql.Connection associated with the
receiver.
|
oracle.jdbc.internal.OracleLargeObject.PrefetchData<byte[]> |
getPrefetchData()
Deprecated.
|
int |
getPrefetchedDataSize()
Deprecated.
|
oracle.jdbc.driver.OracleBlob |
getTarget()
Deprecated.
|
boolean |
isConvertibleTo(java.lang.Class<?> jClass)
Deprecated.
Oracle extension.
|
boolean |
isEmptyLob()
Deprecated.
Return true if the lob locator points to a empty blob.
|
boolean |
isFree()
Deprecated.
|
boolean |
isOpenLob()
Deprecated.
Check whether the BLOB is opened.
|
boolean |
isSecureFile()
Deprecated.
Returns
true 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.
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 to
openLob(int) , which provides the
exact same behavior. |
void |
openLob(int mode)
Deprecated.
Open a BLOB in the indicated mode.
|
void |
openLob(LargeObjectAccessMode mode)
Deprecated.
Public method using enum instead of int
|
long |
position(java.sql.Blob pattern,
long start)
Deprecated.
Implements the Blob interface function.
|
long |
position(byte[] pattern,
long start)
Deprecated.
Implements the Blob interface function.
|
int |
putBytes(long pos,
byte[] bytes)
Deprecated.
This method is deprecated -- use setBytes
|
int |
putBytes(long pos,
byte[] bytes,
int length)
Deprecated.
This method is deprecated -- use setBytes
|
java.io.OutputStream |
setBinaryStream(long pos)
Deprecated.
JDBC 3.0
Retrieves a stream that can be used to write to the
BLOB
value that this Blob 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 the
BLOB value that
this Blob object represents, starting at position
pos , 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 given
byte array to the
BLOB value that this Blob object represents
and returns the number of bytes written. |
void |
setPrefetchData(oracle.jdbc.internal.OracleLargeObject.PrefetchData<byte[]> prefetchData)
Deprecated.
|
java.lang.Object |
toJdbc()
Deprecated.
Oracle extension.
|
java.sql.SQLXML |
toSQLXML()
Deprecated.
Returns an object which impements java.sql.SQLXML with
content take from this Clob.
|
java.sql.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 truncate
|
void |
truncate(long len)
Deprecated.
JDBC 3.0
Truncates the
BLOB value that this Blob
object represents to be len bytes in length. |
assertNotNull, assertNotNull, getConnection, getConnectionDuringExceptionHandling, getOracleConnection
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
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
bigDecimalValue, booleanValue, byteValue, dateValue, doubleValue, floatValue, getBytes, getConnection, getInternalConnection, getLength, getOracleConnection, getStream, intValue, longValue, setPhysicalConnectionOf, setShareBytes, shareBytes, stringValue, stringValue, timestampValue, timestampValue, timeValue, timeValue
close, isOpen, open
public static final int MAX_CHUNK_SIZE
public static final int DURATION_INVALID
public static final int DURATION_SESSION
public static final int DURATION_CALL
public static final int OLD_WRONG_DURATION_SESSION
public static final int OLD_WRONG_DURATION_CALL
public static final int MODE_READONLY
public static final int MODE_READWRITE
protected oracle.jdbc.driver.OracleBlob target
protected BLOB()
protected BLOB(oracle.jdbc.driver.OracleBlob b)
public oracle.jdbc.driver.OracleBlob getTarget()
public long length() throws java.sql.SQLException
length
in interface java.sql.Blob
java.sql.SQLException
public byte[] getBytes(long pos, int length) throws java.sql.SQLException
getBytes
in interface java.sql.Blob
pos
- is the first byte of the blob to be extracted.length
- is the number of consecutive bytes to be copied.pos
argument is larger than the length of the data
the result is null. If the pos
argument
is less than the length of the data, but the sum of pos
argument and the length
is greater than the length of
the data, the result will be smaller than the length requested.
If the length
is zero return and empty arrayjava.sql.SQLException
public java.io.InputStream getBinaryStream() throws java.sql.SQLException
getBinaryStream
in interface java.sql.Blob
java.sql.SQLException
public java.io.InputStream getBinaryStream(boolean isInternal) throws java.sql.SQLException
java.sql.SQLException
public long position(byte[] pattern, long start) throws java.sql.SQLException
position
in interface java.sql.Blob
pattern
- is the pattern to search for.start
- is the position at which to begin searching.java.sql.SQLException
public long position(java.sql.Blob pattern, long start) throws java.sql.SQLException
position
in interface java.sql.Blob
pattern
- is the pattern to search for.start
- is the position at which to begin searching.java.sql.SQLException
public int getBytes(long pos, int length, byte[] buf) throws java.sql.SQLException
getBytes
in interface OracleBlob
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.java.sql.SQLException
public int putBytes(long pos, byte[] bytes) throws java.sql.SQLException
pos
- is the position data to be put.bytes
- is the data to be written into BLOB.java.sql.SQLException
public int putBytes(long pos, byte[] bytes, int length) throws java.sql.SQLException
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.java.sql.SQLException
public java.io.OutputStream getBinaryOutputStream() throws java.sql.SQLException
java.sql.SQLException
public int getChunkSize() throws java.sql.SQLException
java.sql.SQLException
public int getBufferSize() throws java.sql.SQLException
java.sql.SQLException
public static BLOB empty_lob() throws java.sql.SQLException
java.sql.SQLException
public static BLOB getEmptyBLOB() throws java.sql.SQLException
java.sql.SQLException
public boolean isEmptyLob() throws java.sql.SQLException
isEmptyLob
in interface OracleBlob
java.sql.SQLException
public boolean isSecureFile() throws java.sql.SQLException
true
if this is a SecureFile (LOBs with the STORE
AS SECUREFILE option, which were introduced in Oracle Database 11g Release 1).isSecureFile
in interface OracleBlob
true
if this is a SecureFile and false
otherwise.java.sql.SQLException
public java.io.OutputStream getBinaryOutputStream(long pos) throws java.sql.SQLException
pos
- is the position data to be put.java.sql.SQLException
public java.io.InputStream getBinaryStream(long pos) throws java.sql.SQLException
getBinaryStream
in interface OracleBlob
pos
- is the position data to be read, should be greater than 0.java.sql.SQLException
public void trim(long newlen) throws java.sql.SQLException
newlen
- the new length of the BLOB.java.sql.SQLException
public static BLOB createTemporary(java.sql.Connection conn, boolean cache, int _duration) throws java.sql.SQLException
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.java.sql.SQLException
public static void freeTemporary(BLOB temp_lob) throws java.sql.SQLException
temp_lob
- A temporary blob to be freeed.java.sql.SQLException
- if temp_lob is a permanent lob or temp_lob has
already been freed.public static boolean isTemporary(BLOB lob) throws java.sql.SQLException
lob
- the blob to test.java.sql.SQLException
public static short getDuration(BLOB lob) throws java.sql.SQLException
java.sql.SQLException
public void freeTemporary() throws java.sql.SQLException
freeTemporary
in interface oracle.jdbc.internal.OracleLargeObject<byte[]>
java.sql.SQLException
- if self is a permanent lob or self has
already been freed.public boolean isTemporary() throws java.sql.SQLException
isTemporary
in interface oracle.jdbc.internal.OracleLargeObject<byte[]>
isTemporary
in interface OracleBlob
java.sql.SQLException
public short getDuration() throws java.sql.SQLException
getDuration
in interface oracle.jdbc.internal.OracleLargeObject<byte[]>
java.sql.SQLException
public void openLob(LargeObjectAccessMode mode) throws java.sql.SQLException
openLob
in interface OracleBlob
java.sql.SQLException
@Deprecated public void open(int mode) throws java.sql.SQLException
openLob(int)
, which provides the
exact same behavior.java.sql.SQLException
public void openLob(int mode) throws java.sql.SQLException
java.sql.SQLException
public void closeLob() throws java.sql.SQLException
closeLob
in interface OracleBlob
java.sql.SQLException
public boolean isOpenLob() throws java.sql.SQLException
isOpenLob
in interface OracleBlob
java.sql.SQLException
public int setBytes(long pos, byte[] bytes) throws java.sql.SQLException
BLOB
value that
this Blob
object represents, starting at position
pos
, and returns the number of bytes written.setBytes
in interface java.sql.Blob
pos
- the position in the BLOB
object at which
to start writingbytes
- the array of bytes to be written to the BLOB
value that this Blob
object representsjava.sql.SQLException
- if there is an error accessing the
BLOB
valuepublic int setBytes(long pos, byte[] bytes, int offset, int len) throws java.sql.SQLException
byte
array to the
BLOB
value that this Blob
object represents
and returns the number of bytes written.
Writing starts at position pos
in the BLOB
value; len
bytes from the given byte array are written.setBytes
in interface java.sql.Blob
pos
- the position in the BLOB
object at which
to start writingbytes
- the array of bytes to be written to this BLOB
objectoffset
- the offset into the array bytes
at which
to start reading the bytes to be setlen
- the number of bytes to be written to the BLOB
value from the array of bytes bytes
java.sql.SQLException
- if there is an error accessing the
BLOB
valuepublic java.io.OutputStream setBinaryStream(long pos) throws java.sql.SQLException
BLOB
value that this Blob
object represents. The stream begins
at position pos
.setBinaryStream
in interface java.sql.Blob
pos
- the position in the BLOB
value at which
to start writingjava.io.OutputStream
object to which data can
be writtenjava.sql.SQLException
- if there is an error accessing the
BLOB
valuegetBinaryStream()
public void truncate(long len) throws java.sql.SQLException
BLOB
value that this Blob
object represents to be len
bytes in length.truncate
in interface java.sql.Blob
len
- the length, in bytes, to which the BLOB
value
that this Blob
object represents should be truncatedjava.sql.SQLException
- if there is an error accessing the
BLOB
valuepublic java.lang.Object toJdbc() throws java.sql.SQLException
public boolean isConvertibleTo(java.lang.Class<?> jClass)
isConvertibleTo
in interface oracle.jdbc.internal.OracleDatumWithConnection
isConvertibleTo
in class Datum
jClass
- specifies the Java data type to test against.public java.sql.Connection getJavaSqlConnection() throws java.sql.SQLException
DatumWithConnection
getJavaSqlConnection
in interface oracle.jdbc.internal.OracleDatumWithConnection
getJavaSqlConnection
in class DatumWithConnection
java.sql.SQLException
- if an error occurspublic final void setPrefetchData(oracle.jdbc.internal.OracleLargeObject.PrefetchData<byte[]> prefetchData)
setPrefetchData
in interface oracle.jdbc.internal.OracleLargeObject<byte[]>
public final oracle.jdbc.internal.OracleLargeObject.PrefetchData<byte[]> getPrefetchData()
getPrefetchData
in interface oracle.jdbc.internal.OracleLargeObject<byte[]>
public final int getPrefetchedDataSize()
public boolean canReadBasicLobDataInLocator() throws java.sql.SQLException
java.sql.SQLException
public void freeLOB() throws java.sql.SQLException
freeLOB
in interface oracle.jdbc.internal.OracleLargeObject<byte[]>
java.sql.SQLException
public void free() throws java.sql.SQLException
free
in interface java.sql.Blob
java.sql.SQLException
public java.io.InputStream getBinaryStream(long pos, long length) throws java.sql.SQLException
getBinaryStream
in interface java.sql.Blob
pos
- start positionlength
- number of bytes in the resultjava.sql.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.public void setBytes(byte[] locator)
Datum
public java.sql.SQLXML toSQLXML() throws java.sql.SQLException
toSQLXML
in interface OracleBlob
java.sql.SQLException
public java.sql.SQLXML toSQLXML(int csid) throws java.sql.SQLException
toSQLXML
in interface OracleBlob
java.sql.SQLException
public final boolean isFree()
isFree
in interface oracle.jdbc.internal.OracleLargeObject<byte[]>