java.sql.Blob
class ImportBlob
extends java.lang.Object
implements java.sql.Blob
java.sql.BLOB interface
.
Objects created using the ImportBlob
class are
intended to be be used to create a blob object of the data stored
in an import file or as an hex string. Only the routines that
are needed read the blob data for the blob columns by the
inserts done through the VTI have real implementations,
Other routines are dummy ones to satisfy java.sql.Blob
interface.Modifier and Type | Field | Description |
---|---|---|
private byte[] |
blobData |
|
private long |
blobLength |
|
private long |
blobPosition |
|
private ImportLobFile |
lobFile |
Constructor | Description |
---|---|
ImportBlob(byte[] data) |
Create a import Blob object, whose value is the give hex data string.
|
ImportBlob(ImportLobFile lobFile,
long position,
long length) |
Create a import Blob object, that reads
length amount of
data from an external file, starting at position . |
Modifier and Type | Method | Description |
---|---|---|
void |
free() |
Raise error, not used by import
|
java.io.InputStream |
getBinaryStream() |
Returns
BLOB value designated by this
Blob object as a input stream. |
java.io.InputStream |
getBinaryStream(long pos,
long length) |
Raise error, not used by import
|
byte[] |
getBytes(long pos,
int length) |
This routine is not used by the VTI to read the data, so no
implementatio is provided , an exception is thrown if used.
|
long |
length() |
Returns the number of bytes in this
BLOB object. |
private java.sql.SQLException |
methodNotImplemented() |
Return an unimplemented feature error
|
long |
position(byte[] pattern,
long start) |
This routine is not used by the VTI to read the data, so no
implementatio is provided , an exception is thrown if used.
|
long |
position(java.sql.Blob pattern,
long start) |
This routine is not used by the VTI to read the data, so no
implementation is provided , an exception is thrown if used.
|
java.io.OutputStream |
setBinaryStream(long pos) |
This routine is not used by the VTI to read the data, so no
implementation is provided , an exception is thrown if used.
|
int |
setBytes(long pos,
byte[] bytes) |
This routine is not used by the VTI to read the data, so no
implementation is provided , an exception is thrown if used.
|
int |
setBytes(long pos,
byte[] bytes,
int offset,
int len) |
This routine is not used by the VTI to read the data, so no
implementation is provided , an exception is thrown if used.
|
void |
truncate(long len) |
This routine is not used by the VTI to read the data, so no
implementation is provided , an exception is thrown if used.
|
private ImportLobFile lobFile
private long blobPosition
private long blobLength
private byte[] blobData
public ImportBlob(ImportLobFile lobFile, long position, long length)
length
amount of
data from an external file, starting at position
.lobFile
- lob file resource object, using which data is read.position
- byte offset in the file, of this blob columb data.length
- length of this blob object data.public ImportBlob(byte[] data)
data
- byte array that contains the blob data.public long length() throws java.sql.SQLException
BLOB
object.length
in interface java.sql.Blob
BLOB
in bytesjava.sql.SQLException
- on any error.public java.io.InputStream getBinaryStream() throws java.sql.SQLException
BLOB
value designated by this
Blob
object as a input stream.getBinaryStream
in interface java.sql.Blob
BLOB
datajava.sql.SQLException
- if any error occurs while setting up
this blob data in the import file as stream.public byte[] getBytes(long pos, int length) throws java.sql.SQLException
getBytes
in interface java.sql.Blob
java.sql.SQLException
Blob
public long position(byte[] pattern, long start) throws java.sql.SQLException
position
in interface java.sql.Blob
java.sql.SQLException
Blob
public long position(java.sql.Blob pattern, long start) throws java.sql.SQLException
position
in interface java.sql.Blob
java.sql.SQLException
Blob
public int setBytes(long pos, byte[] bytes) throws java.sql.SQLException
setBytes
in interface java.sql.Blob
java.sql.SQLException
Blob
public int setBytes(long pos, byte[] bytes, int offset, int len) throws java.sql.SQLException
setBytes
in interface java.sql.Blob
java.sql.SQLException
Blob
public java.io.OutputStream setBinaryStream(long pos) throws java.sql.SQLException
setBinaryStream
in interface java.sql.Blob
java.sql.SQLException
Blob
public void truncate(long len) throws java.sql.SQLException
truncate
in interface java.sql.Blob
java.sql.SQLException
Blob
public java.io.InputStream getBinaryStream(long pos, long length) throws java.sql.SQLException
getBinaryStream
in interface java.sql.Blob
java.sql.SQLException
public void free() throws java.sql.SQLException
free
in interface java.sql.Blob
java.sql.SQLException
private java.sql.SQLException methodNotImplemented()
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.