类 BlobFromLocator
- java.lang.Object
-
- com.mysql.cj.jdbc.BlobFromLocator
-
- 所有已实现的接口:
Blob
public class BlobFromLocator extends Object implements Blob
The representation (mapping) in the JavaTM programming language of an SQL BLOB value. An SQL BLOB is a built-in type that stores a Binary Large Object as a column value in a row of a database table. The driver implements Blob using an SQL locator(BLOB), which means that a Blob object contains a logical pointer to the SQL BLOB data rather than the data itself. A Blob object is valid for the duration of the transaction in which is was created. Methods in the interfaces ResultSet, CallableStatement, and PreparedStatement, such as getBlob and setBlob allow a programmer to access an SQL BLOB value. The Blob interface provides methods for getting the length of an SQL BLOB (Binary Large Object) value, for materializing a BLOB value on the client, and for determining the position of a pattern of bytes within a BLOB value. This class is new in the JDBC 2.0 API.
-
-
构造器概要
构造器 构造器 说明 BlobFromLocator(ResultSetImpl creatorResultSetToSet, int blobColumnIndex, ExceptionInterceptor exceptionInterceptor)Creates an updatable BLOB that can update in-place
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidfree()InputStreamgetBinaryStream()InputStreamgetBinaryStream(long pos, long length)byte[]getBytes(long pos, int length)longlength()longposition(byte[] pattern, long start)longposition(Blob pattern, long start)OutputStreamsetBinaryStream(long indexToWriteAt)intsetBytes(long writeAt, byte[] bytes)intsetBytes(long writeAt, byte[] bytes, int offset, int length)voidtruncate(long length)
-
-
-
构造器详细资料
-
BlobFromLocator
public BlobFromLocator(ResultSetImpl creatorResultSetToSet, int blobColumnIndex, ExceptionInterceptor exceptionInterceptor) throws SQLException
Creates an updatable BLOB that can update in-place- 参数:
creatorResultSetToSet- result setblobColumnIndex- column indexexceptionInterceptor- exception interceptor- 抛出:
SQLException- if an error occurs
-
-
方法详细资料
-
setBinaryStream
public OutputStream setBinaryStream(long indexToWriteAt) throws SQLException
- 指定者:
setBinaryStream在接口中Blob- 抛出:
SQLException
-
getBinaryStream
public InputStream getBinaryStream() throws SQLException
- 指定者:
getBinaryStream在接口中Blob- 抛出:
SQLException
-
setBytes
public int setBytes(long writeAt, byte[] bytes, int offset, int length) throws SQLException- 指定者:
setBytes在接口中Blob- 抛出:
SQLException
-
setBytes
public int setBytes(long writeAt, byte[] bytes) throws SQLException- 指定者:
setBytes在接口中Blob- 抛出:
SQLException
-
getBytes
public byte[] getBytes(long pos, int length) throws SQLException- 指定者:
getBytes在接口中Blob- 抛出:
SQLException
-
length
public long length() throws SQLException- 指定者:
length在接口中Blob- 抛出:
SQLException
-
position
public long position(Blob pattern, long start) throws SQLException
- 指定者:
position在接口中Blob- 抛出:
SQLException
-
position
public long position(byte[] pattern, long start) throws SQLException- 指定者:
position在接口中Blob- 抛出:
SQLException
-
truncate
public void truncate(long length) throws SQLException- 指定者:
truncate在接口中Blob- 抛出:
SQLException
-
free
public void free() throws SQLException- 指定者:
free在接口中Blob- 抛出:
SQLException
-
getBinaryStream
public InputStream getBinaryStream(long pos, long length) throws SQLException
- 指定者:
getBinaryStream在接口中Blob- 抛出:
SQLException
-
-