Package org.apache.derby.impl.load
Class ImportBlob
- java.lang.Object
-
- org.apache.derby.impl.load.ImportBlob
-
- All Implemented Interfaces:
java.sql.Blob
class ImportBlob extends java.lang.Object implements java.sql.Blob
This class implementsjava.sql.BLOB interface
. Objects created using theImportBlob
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 satisfyjava.sql.Blob
interface.
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]
blobData
private long
blobLength
private long
blobPosition
private ImportLobFile
lobFile
-
Constructor Summary
Constructors 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 readslength
amount of data from an external file, starting atposition
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
free()
Raise error, not used by importjava.io.InputStream
getBinaryStream()
ReturnsBLOB
value designated by thisBlob
object as a input stream.java.io.InputStream
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 java.sql.SQLException
methodNotImplemented()
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
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.
-
-
-
Field Detail
-
lobFile
private ImportLobFile lobFile
-
blobPosition
private long blobPosition
-
blobLength
private long blobLength
-
blobData
private byte[] blobData
-
-
Constructor Detail
-
ImportBlob
public ImportBlob(ImportLobFile lobFile, long position, long length)
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 Detail
-
length
public long length() throws java.sql.SQLException
Returns the number of bytes in thisBLOB
object.- Specified by:
length
in interfacejava.sql.Blob
- Returns:
- length of the
BLOB
in bytes - Throws:
java.sql.SQLException
- on any error.
-
getBinaryStream
public java.io.InputStream getBinaryStream() throws java.sql.SQLException
ReturnsBLOB
value designated by thisBlob
object as a input stream.- Specified by:
getBinaryStream
in interfacejava.sql.Blob
- Returns:
- a stream containing the
BLOB
data - Throws:
java.sql.SQLException
- if any error occurs while setting up this blob data in the import file as stream.
-
getBytes
public byte[] getBytes(long pos, int length) throws java.sql.SQLException
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 interfacejava.sql.Blob
- Throws:
java.sql.SQLException
- See Also:
Blob
-
position
public long position(byte[] pattern, long start) throws java.sql.SQLException
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 interfacejava.sql.Blob
- Throws:
java.sql.SQLException
- See Also:
Blob
-
position
public long position(java.sql.Blob pattern, long start) throws java.sql.SQLException
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 interfacejava.sql.Blob
- Throws:
java.sql.SQLException
- See Also:
Blob
-
setBytes
public int setBytes(long pos, byte[] bytes) throws java.sql.SQLException
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 interfacejava.sql.Blob
- Throws:
java.sql.SQLException
- See Also:
Blob
-
setBytes
public int setBytes(long pos, byte[] bytes, int offset, int len) throws java.sql.SQLException
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 interfacejava.sql.Blob
- Throws:
java.sql.SQLException
- See Also:
Blob
-
setBinaryStream
public java.io.OutputStream setBinaryStream(long pos) throws java.sql.SQLException
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 interfacejava.sql.Blob
- Throws:
java.sql.SQLException
- See Also:
Blob
-
truncate
public void truncate(long len) throws java.sql.SQLException
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 interfacejava.sql.Blob
- Throws:
java.sql.SQLException
- See Also:
Blob
-
getBinaryStream
public java.io.InputStream getBinaryStream(long pos, long length) throws java.sql.SQLException
Raise error, not used by import- Specified by:
getBinaryStream
in interfacejava.sql.Blob
- Throws:
java.sql.SQLException
-
free
public void free() throws java.sql.SQLException
Raise error, not used by import- Specified by:
free
in interfacejava.sql.Blob
- Throws:
java.sql.SQLException
-
methodNotImplemented
private java.sql.SQLException methodNotImplemented()
Return an unimplemented feature error
-
-