Package org.apache.derby.impl.load
Class ImportBlob
java.lang.Object
org.apache.derby.impl.load.ImportBlob
- All Implemented Interfaces:
Blob
This class implements
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.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionImportBlob
(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 readslength
amount of data from an external file, starting atposition
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
free()
Raise error, not used by importReturnsBLOB
value designated by thisBlob
object as a input stream.getBinaryStream
(long pos, long length) Raise error, not used by importbyte[]
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 thisBLOB
object.private SQLException
Return an unimplemented feature errorlong
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
This routine is not used by the VTI to read the data, so no implementation is provided , an exception is thrown if used.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.
-
Field Details
-
lobFile
-
blobPosition
private long blobPosition -
blobLength
private long blobLength -
blobData
private byte[] blobData
-
-
Constructor Details
-
ImportBlob
Create a import Blob object, that readslength
amount of data from an external file, starting atposition
.- Parameters:
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.
-
ImportBlob
public ImportBlob(byte[] data) Create a import Blob object, whose value is the give hex data string.- Parameters:
data
- byte array that contains the blob data.
-
-
Method Details
-
length
Returns the number of bytes in thisBLOB
object.- Specified by:
length
in interfaceBlob
- Returns:
- length of the
BLOB
in bytes - Throws:
SQLException
- on any error.
-
getBinaryStream
ReturnsBLOB
value designated by thisBlob
object as a input stream.- Specified by:
getBinaryStream
in interfaceBlob
- Returns:
- a stream containing the
BLOB
data - Throws:
SQLException
- if any error occurs while setting up this blob data in the import file as stream.
-
getBytes
This routine is not used by the VTI to read the data, so no implementatio is provided , an exception is thrown if used.- Specified by:
getBytes
in interfaceBlob
- Throws:
SQLException
- See Also:
-
position
This routine is not used by the VTI to read the data, so no implementatio is provided , an exception is thrown if used.- Specified by:
position
in interfaceBlob
- Throws:
SQLException
- See Also:
-
position
This routine is not used by the VTI to read the data, so no implementation is provided , an exception is thrown if used.- Specified by:
position
in interfaceBlob
- Throws:
SQLException
- See Also:
-
setBytes
This routine is not used by the VTI to read the data, so no implementation is provided , an exception is thrown if used.- Specified by:
setBytes
in interfaceBlob
- Throws:
SQLException
- See Also:
-
setBytes
This routine is not used by the VTI to read the data, so no implementation is provided , an exception is thrown if used.- Specified by:
setBytes
in interfaceBlob
- Throws:
SQLException
- See Also:
-
setBinaryStream
This routine is not used by the VTI to read the data, so no implementation is provided , an exception is thrown if used.- Specified by:
setBinaryStream
in interfaceBlob
- Throws:
SQLException
- See Also:
-
truncate
This routine is not used by the VTI to read the data, so no implementation is provided , an exception is thrown if used.- Specified by:
truncate
in interfaceBlob
- Throws:
SQLException
- See Also:
-
getBinaryStream
Raise error, not used by import- Specified by:
getBinaryStream
in interfaceBlob
- Throws:
SQLException
-
free
Raise error, not used by import- Specified by:
free
in interfaceBlob
- Throws:
SQLException
-
methodNotImplemented
Return an unimplemented feature error
-