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
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, Connection
java.sql.Blob blob = connection.createBlob();
Blob
, OracleBlob
, Connection.createBlob()
, Serialized FormModifier 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.
|
static boolean |
TRACE |
Deprecated.
|
ojiOracleDatumWithConnection, targetDatum
targetDatumWithConnection
Modifier | Constructor | Description |
---|---|---|
protected |
BLOB() |
Deprecated.
|
protected |
BLOB(oracle.jdbc.driver.OracleBlob b) |
Deprecated.
Call from empty lob static method
|
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 instead
|
void |
free() |
Deprecated.
Free the resources the blob 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 setBinaryStream
|
InputStream |
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 LOB
|
static short |
getDuration(BLOB lob) |
Deprecated.
return the duration of a temporary LOB
|
static 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.
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.
Open a BLOB in the indicated mode.
|
void |
open(LargeObjectAccessMode mode) |
Deprecated.
Public method using enum instead of int
|
long |
position(byte[] pattern, long start) |
Deprecated.
Implements the Blob interface function.
|
long |
position(Blob 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
|
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. |
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 truncate
|
void |
truncate(long len) |
Deprecated.
JDBC 3.0 Truncates the
BLOB value that this Blob object represents to be len bytes in length. |
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
assertNotNull, assertNotNull, getConnection, getConnectionDuringExceptionHandling, getOracleConnection
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
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
public static final boolean TRACE
protected BLOB()
protected BLOB(oracle.jdbc.driver.OracleBlob b)
public oracle.jdbc.driver.OracleBlob getTarget()
public long length() throws SQLException
length
in interface Blob
SQLException
public byte[] getBytes(long pos, int length) throws SQLException
getBytes
in interface 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 arraySQLException
public InputStream getBinaryStream() throws SQLException
getBinaryStream
in interface Blob
SQLException
public InputStream getBinaryStream(boolean isInternal) throws SQLException
SQLException
public long position(byte[] pattern, long start) throws SQLException
position
in interface Blob
pattern
- is the pattern to search for.start
- is the position at which to begin searching.SQLException
public long position(Blob pattern, long start) throws SQLException
position
in interface Blob
pattern
- is the pattern to search for.start
- is the position at which to begin searching.SQLException
public int getBytes(long pos, int length, byte[] buf) throws 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.SQLException
public int putBytes(long pos, byte[] bytes) throws SQLException
putBytes
in interface oracle.jdbc.internal.OracleBlob
pos
- is the position data to be put.bytes
- is the data to be written into BLOB.SQLException
public int putBytes(long pos, byte[] bytes, int length) throws SQLException
putBytes
in interface oracle.jdbc.internal.OracleBlob
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.SQLException
public OutputStream getBinaryOutputStream() throws SQLException
getBinaryOutputStream
in interface oracle.jdbc.internal.OracleBlob
SQLException
public int getChunkSize() throws SQLException
getChunkSize
in interface oracle.jdbc.internal.OracleBlob
SQLException
public int getBufferSize() throws SQLException
getBufferSize
in interface oracle.jdbc.internal.OracleBlob
SQLException
public static BLOB empty_lob() throws SQLException
SQLException
public static BLOB getEmptyBLOB() throws SQLException
SQLException
public boolean isEmptyLob() throws SQLException
isEmptyLob
in interface OracleBlob
SQLException
public boolean isSecureFile() throws 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.SQLException
public OutputStream getBinaryOutputStream(long pos) throws SQLException
getBinaryOutputStream
in interface oracle.jdbc.internal.OracleBlob
pos
- is the position data to be put.SQLException
public InputStream getBinaryStream(long pos) throws SQLException
getBinaryStream
in interface OracleBlob
pos
- is the position data to be read, should be greater than 0.SQLException
public void trim(long newlen) throws SQLException
trim
in interface oracle.jdbc.internal.OracleBlob
newlen
- the new length of the BLOB.SQLException
public static BLOB createTemporary(Connection conn, boolean cache, int _duration) throws 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.SQLException
public static void freeTemporary(BLOB temp_lob) throws SQLException
temp_lob
- A temporary blob to be freeed.SQLException
- if temp_lob is a permanent lob or temp_lob has already been freed.public static boolean isTemporary(BLOB lob) throws SQLException
lob
- the blob to test.SQLException
public static short getDuration(BLOB lob) throws SQLException
SQLException
public void freeTemporary() throws SQLException
freeTemporary
in interface oracle.jdbc.internal.OracleLargeObject
SQLException
- if self is a permanent lob or self has already been freed.public boolean isTemporary() throws SQLException
isTemporary
in interface OracleBlob
isTemporary
in interface oracle.jdbc.internal.OracleLargeObject
SQLException
public short getDuration() throws SQLException
getDuration
in interface oracle.jdbc.internal.OracleLargeObject
SQLException
public void open(LargeObjectAccessMode mode) throws SQLException
open
in interface OracleBlob
SQLException
public void open(int mode) throws SQLException
SQLException
public void close() throws SQLException
close
in interface OracleBlob
SQLException
public boolean isOpen() throws SQLException
isOpen
in interface OracleBlob
SQLException
public int setBytes(long pos, byte[] bytes) throws SQLException
BLOB
value that this Blob
object represents, starting at position pos
, and returns the number of bytes written.setBytes
in interface 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 representsSQLException
- if there is an error accessing the BLOB
valuepublic int setBytes(long pos, byte[] bytes, int offset, int len) throws 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 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
SQLException
- if there is an error accessing the BLOB
valuepublic OutputStream setBinaryStream(long pos) throws SQLException
BLOB
value that this Blob
object represents. The stream begins at position pos
.setBinaryStream
in interface Blob
pos
- the position in the BLOB
value at which to start writingjava.io.OutputStream
object to which data can be writtenSQLException
- if there is an error accessing the BLOB
valuegetBinaryStream()
public void truncate(long len) throws SQLException
BLOB
value that this Blob
object represents to be len
bytes in length.truncate
in interface Blob
len
- the length, in bytes, to which the BLOB
value that this Blob
object represents should be truncatedSQLException
- if there is an error accessing the BLOB
valuepublic Object toJdbc() throws SQLException
toJdbc
in interface oracle.jdbc.internal.OracleBlob
toJdbc
in interface oracle.jdbc.internal.OracleDatumWithConnection
toJdbc
in class Datum
SQLException
- if any of the lower layer code throws an exception.public boolean isConvertibleTo(Class jClass)
isConvertibleTo
in interface oracle.jdbc.internal.OracleBlob
isConvertibleTo
in interface oracle.jdbc.internal.OracleDatumWithConnection
isConvertibleTo
in class Datum
jClass
- specifies the Java data type to test against.public Connection getJavaSqlConnection() throws SQLException
DatumWithConnection
getJavaSqlConnection
in interface oracle.jdbc.internal.OracleBlob
getJavaSqlConnection
in interface oracle.jdbc.internal.OracleDatumWithConnection
getJavaSqlConnection
in class DatumWithConnection
SQLException
- if an error occurspublic final int getPrefetchedDataSize()
getPrefetchedDataSize
in interface oracle.jdbc.internal.OracleBlob
public boolean canReadBasicLobDataInLocator() throws SQLException
canReadBasicLobDataInLocator
in interface oracle.jdbc.internal.OracleBlob
SQLException
public void free() throws SQLException
free
in interface Blob
SQLException
public InputStream getBinaryStream(long pos, long length) throws SQLException
getBinaryStream
in interface Blob
pos
- start positionlength
- number of bytes in the resultSQLException
- 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 SQLXML toSQLXML() throws SQLException
toSQLXML
in interface OracleBlob
SQLException
public SQLXML toSQLXML(int csid) throws SQLException
toSQLXML
in interface OracleBlob
SQLException