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 readslengthamount of data from an external file, starting atposition. -
Method Summary
Modifier and TypeMethodDescriptionvoidfree()Raise error, not used by importReturnsBLOBvalue designated by thisBlobobject 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.longlength()Returns the number of bytes in thisBLOBobject.private SQLExceptionReturn an unimplemented feature errorlongposition(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.longThis 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.intsetBytes(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.intsetBytes(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.voidtruncate(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 readslengthamount 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 thisBLOBobject.- Specified by:
lengthin interfaceBlob- Returns:
- length of the
BLOBin bytes - Throws:
SQLException- on any error.
-
getBinaryStream
ReturnsBLOBvalue designated by thisBlobobject as a input stream.- Specified by:
getBinaryStreamin interfaceBlob- Returns:
- a stream containing the
BLOBdata - 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:
getBytesin 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:
positionin 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:
positionin 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:
setBytesin 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:
setBytesin 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:
setBinaryStreamin 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:
truncatein interfaceBlob- Throws:
SQLException- See Also:
-
getBinaryStream
Raise error, not used by import- Specified by:
getBinaryStreamin interfaceBlob- Throws:
SQLException
-
free
Raise error, not used by import- Specified by:
freein interfaceBlob- Throws:
SQLException
-
methodNotImplemented
Return an unimplemented feature error
-