Class ImportBlob

  • All Implemented Interfaces:
    java.sql.Blob

    class ImportBlob
    extends java.lang.Object
    implements java.sql.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.
    • 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 reads length amount of data from an external file, starting at position .
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • 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 reads length amount of data from an external file, starting at position .
        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 this BLOB object.
        Specified by:
        length in interface java.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
        Returns BLOB value designated by this Blob object as a input stream.
        Specified by:
        getBinaryStream in interface java.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 interface java.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 interface java.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 interface java.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 interface java.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 interface java.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 interface java.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 interface java.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 interface java.sql.Blob
        Throws:
        java.sql.SQLException
      • free

        public void free()
                  throws java.sql.SQLException
        Raise error, not used by import
        Specified by:
        free in interface java.sql.Blob
        Throws:
        java.sql.SQLException
      • methodNotImplemented

        private java.sql.SQLException methodNotImplemented()
        Return an unimplemented feature error