public abstract class Lob extends Object implements Serializable
| 限定符和类型 | 字段和说明 |
|---|---|
protected String |
charData |
protected byte[] |
data |
protected static int |
DBMS_LOB_MAX_AMOUNT |
protected String |
encoding |
protected ExceptionInterceptor |
exceptionInterceptor |
protected boolean |
isOracleMode |
protected int |
length |
protected int |
lengthFromServer |
protected com.oceanbase.jdbc.ObLobLocator |
locator |
protected int |
offset |
| 构造器和说明 |
|---|
Lob() |
Lob(byte[] bytes)
Creates a blob with content.
|
Lob(byte[] bytes,
ExceptionInterceptor exceptionInterceptor) |
Lob(byte[] bytes,
int offset,
int length)
Creates a blob with content.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
buildObLobLocatorV1(boolean isBinary,
Buffer buffer,
long magicCode,
long version,
OceanBaseConnection conn) |
void |
buildObLobLocatorV2(boolean isBinary,
Buffer buffer,
long magicCode,
long version,
OceanBaseConnection conn) |
void |
clearData() |
void |
copy(Lob lob) |
void |
free()
This method frees the
Blob object and releases the resources that it holds. |
InputStream |
getBinaryStream() |
InputStream |
getBinaryStream(long pos,
long length) |
byte[] |
getBytes(long pos,
int length) |
com.oceanbase.jdbc.ObLobLocator |
getLocator() |
boolean |
isEmptyLob() |
protected abstract void |
readFromServer() |
OutputStream |
setBinaryStream(long pos)
Retrieves a stream that can be used to write to the
BLOB value that this
Blob object represents. |
int |
setBytes(long pos,
byte[] bytes) |
protected static int DBMS_LOB_MAX_AMOUNT
protected byte[] data
protected transient int offset
protected transient int length
protected com.oceanbase.jdbc.ObLobLocator locator
protected String encoding
protected String charData
protected int lengthFromServer
protected ExceptionInterceptor exceptionInterceptor
protected boolean isOracleMode
public Lob()
public Lob(byte[] bytes)
bytes - the content for the blob.public Lob(byte[] bytes,
ExceptionInterceptor exceptionInterceptor)
public Lob(byte[] bytes,
int offset,
int length)
bytes - the content for the blob.offset - offsetlength - lengthpublic void copy(Lob lob)
public void clearData()
public void buildObLobLocatorV1(boolean isBinary,
Buffer buffer,
long magicCode,
long version,
OceanBaseConnection conn)
throws SQLException
SQLExceptionpublic void buildObLobLocatorV2(boolean isBinary,
Buffer buffer,
long magicCode,
long version,
OceanBaseConnection conn)
throws SQLException
SQLExceptionpublic OutputStream setBinaryStream(long pos) throws SQLException
BLOB value that this
Blob object represents. The stream begins at position pos. The bytes
written to the stream will overwrite the existing bytes in the Blob object
starting at the position pos. If the end of the Blob value is reached
while writing to the stream, then the length of the Blob value will be increased
to accommodate the extra bytes.
Note: If the value specified for pos is greater then the length+1 of the
BLOB value then the behavior is undefined. Some JDBC drivers may throw a
SQLException while other drivers may support this operation.
pos - the position in the BLOB value at which to start writing; the first
position is 1java.io.OutputStream object to which data can be writtenSQLException - if there is an error accessing the BLOB value or if pos is
less than 1getBinaryStream()public InputStream getBinaryStream() throws SQLException
SQLExceptionpublic InputStream getBinaryStream(long pos, long length) throws SQLException
SQLExceptionpublic int setBytes(long pos,
byte[] bytes)
throws SQLException
SQLExceptionpublic void free()
Blob object and releases the resources that it holds. The
object is invalid once the free method is called.
After free has been called, any attempt to invoke a method other than
free will result in a SQLException being thrown. If free is
called multiple times, the subsequent calls to free are treated as a no-op.
public boolean isEmptyLob()
public byte[] getBytes(long pos,
int length)
throws SQLException
SQLExceptionpublic com.oceanbase.jdbc.ObLobLocator getLocator()
protected abstract void readFromServer()
throws SQLException
SQLExceptionCopyright © 2024 oceanbase.com. All rights reserved.