|
Oracle JDBC API Reference 11g Release 2 ("11.2.0.3.0") |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.sql.Datum oracle.sql.DatumWithConnection oracle.sql.BLOB
public class BLOB
This class implements the java.sql.Blob interface in JDBC 2.0
Field Summary | |
---|---|
static java.lang.String |
BUILD_DATE
|
static int |
DURATION_CALL
|
static int |
DURATION_SESSION
|
static int |
MAX_CHUNK_SIZE
1907584: Changed MAX_CHUNK_SIZE from 32512 to 32768. |
static int |
MODE_READONLY
|
static int |
MODE_READWRITE
|
static boolean |
TRACE
|
Method Summary | |
---|---|
void |
close()
Close a previously opened BLOB. |
static BLOB |
createTemporary(java.sql.Connection conn,
boolean cache,
int _duration)
Create a temporary blob. |
static BLOB |
empty_lob()
Deprecated. use getEmptyBLOB instead |
void |
freeTemporary()
Free the contents and the locator of the temporary blob. |
static void |
freeTemporary(BLOB temp_lob)
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()
Implements the Blob interface function. |
java.io.InputStream |
getBinaryStream(long pos)
Read from the BLOB as a stream at the requested position. |
int |
getBufferSize()
Oracle extension. |
byte[] |
getBytes(long pos,
int length)
Implements the Blob interface function. |
int |
getBytes(long pos,
int length,
byte[] buf)
Oracle extension. |
int |
getChunkSize()
Oracle extension. |
static BLOB |
getEmptyBLOB()
Return a empty lob. |
java.sql.Connection |
getJavaSqlConnection()
Oracle extension Return the java.sql.Connection associated with the receiver. |
int |
getPrefetchedDataSize()
|
boolean |
isConvertibleTo(java.lang.Class jClass)
Oracle extension. |
boolean |
isEmptyLob()
Return true if the lob locator points to a empty blob. |
boolean |
isOpen()
Check whether the BLOB is opened. |
boolean |
isSecureFile()
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()
Return true if the lob locator points to a temporary blob. |
static boolean |
isTemporary(BLOB lob)
Return true if the lob locator points to a temporary blob. |
long |
length()
Implements the Blob interface function. |
void |
open(int mode)
Open a BLOB in the indicated mode. |
void |
open(LargeObjectAccessMode mode)
Public method using enum instead of int |
long |
position(java.sql.Blob pattern,
long start)
Implements the Blob interface function. |
long |
position(byte[] pattern,
long start)
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)
JDBC 3.0 Retrieves a stream that can be used to write to the BLOB
value that this Blob object represents. |
int |
setBytes(long pos,
byte[] bytes)
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)
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. |
java.lang.Object |
toJdbc()
Oracle extension. |
void |
trim(long newlen)
Deprecated. This method id deprecated -- use truncate |
void |
truncate(long len)
JDBC 3.0 Truncates the BLOB value that this Blob
object represents to be len bytes in length. |
Methods inherited from class oracle.sql.DatumWithConnection |
---|
assertNotNull, assertNotNull, getConnection, getOracleConnection |
Methods inherited from class oracle.sql.Datum |
---|
bigDecimalValue, booleanValue, byteValue, dateValue, doubleValue, equals, floatValue, getBytes, getLength, getStream, intValue, longValue, setBytes, setShareBytes, shareBytes, stringValue, stringValue, timestampValue, timestampValue, timeValue, timeValue |
Methods inherited from class java.lang.Object |
---|
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, setBytes, setPhysicalConnectionOf, setShareBytes, shareBytes, stringValue, stringValue, timestampValue, timestampValue, timeValue, timeValue |
Field Detail |
---|
public static final int MAX_CHUNK_SIZE
public static final int DURATION_SESSION
public static final int DURATION_CALL
public static final int MODE_READONLY
public static final int MODE_READWRITE
public static final java.lang.String BUILD_DATE
public static final boolean TRACE
Method Detail |
---|
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 array
java.sql.SQLException
public java.io.InputStream getBinaryStream() throws java.sql.SQLException
getBinaryStream
in interface java.sql.Blob
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.
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 void freeTemporary() throws java.sql.SQLException
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 OracleBlob
java.sql.SQLException
public void open(LargeObjectAccessMode mode) throws java.sql.SQLException
open
in interface OracleBlob
java.sql.SQLException
public void open(int mode) throws java.sql.SQLException
java.sql.SQLException
public void close() throws java.sql.SQLException
close
in interface OracleBlob
java.sql.SQLException
public boolean isOpen() throws java.sql.SQLException
isOpen
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 represents
java.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 writing
java.io.OutputStream
object to which data can
be written
java.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 truncated
java.sql.SQLException
- if there is an error accessing the
BLOB
valuepublic java.lang.Object toJdbc() throws java.sql.SQLException
toJdbc
in interface oracle.jdbc.internal.OracleDatumWithConnection
toJdbc
in class Datum
java.sql.SQLException
- if any of the lower layer code throws an exception.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 int getPrefetchedDataSize()
|
Oracle JDBC API Reference 11g Release 2 ("11.2.0.3.0") |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |