APIdia Launch Partner
Top Fields Constructors Methods
net.ucanaccess.jdbc

public Class UcanaccessBlob

extends Object
implements Blob
Class Inheritance
All Implemented Interfaces
java.sql.Blob, java.lang.AutoCloseable
Imports
io.github.spannm.jackcess.util.OleBlob, .OleBlob.Content, net.ucanaccess.exception.UcanaccessSQLException, net.ucanaccess.util.Try, java.io.*, java.sql.Blob, .SQLException

Field Summary

Modifier and TypeField and Description
private Blob
private final UcanaccessConnection
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Blob
public static Blob
public void
free()

Implements java.sql.Blob.free.

Closes and releases the resources held by this Blob object.

public InputStream
getBinaryStream()

Implements java.sql.Blob.getBinaryStream.

Retrieves the BLOB value designated by this Blob instance as a stream.

public InputStream
getBinaryStream(long pos, long length)

Implements java.sql.Blob.getBinaryStream.

Returns an InputStream object that contains a partial Blob value, starting with the byte specified by pos, which is length bytes in length.

public byte[]
getBytes(long pos, int length)

Implements java.sql.Blob.getBytes.

Retrieves all or part of the BLOB value that this Blob object represents, as an array of bytes.

public long
length()

Implements java.sql.Blob.length.

Returns the number of bytes in the BLOB value designated by this Blob object.

public long
position(Blob pattern, long start)

Implements java.sql.Blob.position.

Retrieves the byte position in the BLOB value designated by this Blob object at which pattern begins.

public long
position(byte[] pattern, long start)

Implements java.sql.Blob.position.

Retrieves the byte position at which the specified byte array pattern begins within the BLOB value that this Blob object represents.

public OutputStream
setBinaryStream(long pos)

Implements java.sql.Blob.setBinaryStream.

Retrieves a stream that can be used to write to the BLOB value that this Blob object represents.

public int
setBytes(long pos, byte[] bytes)

Implements java.sql.Blob.setBytes.

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.

public int
setBytes(long pos, byte[] bytes, int offset, int len)

Implements java.sql.Blob.setBytes.

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.

public void
truncate(long len)

Implements java.sql.Blob.truncate.

Truncates the BLOB value that this Blob object represents to be len bytes in length.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

blobback to summary
private Blob blob
connback to summary
private final UcanaccessConnection conn
usingBlobKeyback to summary
private boolean usingBlobKey

Constructor Detail

UcanaccessBlobback to summary
public UcanaccessBlob(Blob blob, UcanaccessConnection conn) throws SQLException

Method Detail

createBlobback to summary
public static Blob createBlob(File fl, UcanaccessConnection conn) throws UcanaccessSQLException
createBlobback to summary
public static Blob createBlob(UcanaccessConnection conn) throws SQLException
freeback to summary
public void free() throws SQLException

Implements java.sql.Blob.free.

Doc from java.sql.Blob.free.

Closes and releases the resources held by this Blob object.

If the Blob object is already closed, then invoking this method has no effect.

Annotations
@Override
Exceptions
SQLException:
if an error occurs releasing the Blob's resources
getBinaryStreamback to summary
public InputStream getBinaryStream() throws SQLException

Implements java.sql.Blob.getBinaryStream.

Doc from java.sql.Blob.getBinaryStream.

Retrieves the BLOB value designated by this Blob instance as a stream.

Annotations
@Override
Exceptions
SQLException:
if there is an error accessing the BLOB value
getBinaryStreamback to summary
public InputStream getBinaryStream(long pos, long length) throws SQLException

Implements java.sql.Blob.getBinaryStream.

Doc from java.sql.Blob.getBinaryStream.

Returns an InputStream object that contains a partial Blob value, starting with the byte specified by pos, which is length bytes in length.

Annotations
@Override
Exceptions
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
getBytesback to summary
public byte[] getBytes(long pos, int length) throws SQLException

Implements java.sql.Blob.getBytes.

Doc from java.sql.Blob.getBytes.

Retrieves all or part of the BLOB value that this Blob object represents, as an array of bytes. This byte array contains up to length consecutive bytes starting at position pos.

Annotations
@Override
Exceptions
SQLException:
if there is an error accessing the BLOB value; if pos is less than 1 or length is less than 0
lengthback to summary
public long length() throws SQLException

Implements java.sql.Blob.length.

Doc from java.sql.Blob.length.

Returns the number of bytes in the BLOB value designated by this Blob object.

Annotations
@Override
Exceptions
SQLException:
if there is an error accessing the length of the BLOB
positionback to summary
public long position(Blob pattern, long start) throws SQLException

Implements java.sql.Blob.position.

Doc from java.sql.Blob.position.

Retrieves the byte position in the BLOB value designated by this Blob object at which pattern begins. The search begins at position start.

Annotations
@Override
Exceptions
SQLException:
if there is an error accessing the BLOB value or if start is less than 1
positionback to summary
public long position(byte[] pattern, long start) throws SQLException

Implements java.sql.Blob.position.

Doc from java.sql.Blob.position.

Retrieves the byte position at which the specified byte array pattern begins within the BLOB value that this Blob object represents. The search for pattern begins at position start.

Annotations
@Override
Exceptions
SQLException:
if there is an error accessing the BLOB or if start is less than 1
setBinaryStreamback to summary
public OutputStream setBinaryStream(long pos) throws SQLException

Implements java.sql.Blob.setBinaryStream.

Doc from java.sql.Blob.setBinaryStream.

Retrieves a stream that can be used to write to the 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 than the length+1 of the BLOB value then the behavior is undefined. Some JDBC drivers may throw an SQLException while other drivers may support this operation.

Annotations
@Override
Exceptions
SQLException:
if there is an error accessing the BLOB value or if pos is less than 1
setBytesback to summary
public int setBytes(long pos, byte[] bytes) throws SQLException

Implements java.sql.Blob.setBytes.

Doc from java.sql.Blob.setBytes.

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. The array of bytes 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 the array of bytes, then the length of the Blob value will be increased to accommodate the extra bytes.

Note

If the value specified for pos is greater than the length+1 of the BLOB value then the behavior is undefined. Some JDBC drivers may throw an SQLException while other drivers may support this operation.

Annotations
@Override
Exceptions
SQLException:
if there is an error accessing the BLOB value or if pos is less than 1
setBytesback to summary
public int setBytes(long pos, byte[] bytes, int offset, int len) throws SQLException

Implements java.sql.Blob.setBytes.

Doc from java.sql.Blob.setBytes.

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. Writing starts at position pos in the BLOB value; len bytes from the given byte array are written. The array of bytes 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 the array of bytes, then the length of the Blob value will be increased to accommodate the extra bytes.

Note

If the value specified for pos is greater than the length+1 of the BLOB value then the behavior is undefined. Some JDBC drivers may throw an SQLException while other drivers may support this operation.

Annotations
@Override
Exceptions
SQLException:
if there is an error accessing the BLOB value or if pos is less than 1
truncateback to summary
public void truncate(long len) throws SQLException

Implements java.sql.Blob.truncate.

Doc from java.sql.Blob.truncate.

Truncates the BLOB value that this Blob object represents to be len bytes in length.

Note

If the value specified for pos is greater than the length+1 of the BLOB value then the behavior is undefined. Some JDBC drivers may throw an SQLException while other drivers may support this operation.

Annotations
@Override
Exceptions
SQLException:
if there is an error accessing the BLOB value or if len is less than 0