Class ImportClob

  • All Implemented Interfaces:
    java.sql.Clob

    class ImportClob
    extends java.lang.Object
    implements java.sql.Clob
    This class implements java.sql.CLOB interface . Objects created using the ImportClob class are intended to be be used to create a clob object of the data stored in an import file. Only the routines that are needed to read the clob data for the clob columns by the inserts done through the VTI have real implementations, Other routines are dummy ones to satisfy java.sql.Clob interface.
    • Constructor Summary

      Constructors 
      Constructor Description
      ImportClob​(java.lang.String data)
      Create a Clob object, whose value is given as string.
      ImportClob​(ImportLobFile lobFile, long position, long length)
      Create a import Clob 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 getAsciiStream()
      This routine is not used by the VTI to read the data, so no implementation is provided, an exception is thrown if it is called.
      java.io.Reader getCharacterStream()
      Returns CLOB value designated by this Clob object as a Reader .
      java.io.Reader getCharacterStream​(long pos, long length)
      Raise error, not used by import
      java.lang.String getSubString​(long pos, int length)
      This routine is not used by the VTI to read the data, so no implementation is provided, an exception is thrown if it is called.
      long length()
      Returns the number of characters in this CLOB object.
      private java.sql.SQLException methodNotImplemented()
      Return an unimplemented feature error
      long position​(java.lang.String searchstr, long start)
      This routine is not used by the VTI to read the data, so no implementation is provided, an exception is thrown if it is called.
      long position​(java.sql.Clob searchstr, long start)
      This routine is not used by the VTI to read the data, so no implementation is provided, an exception is thrown if it is called.
      java.io.OutputStream setAsciiStream​(long pos)
      This routine is not used by the VTI to read the data, so no implementation is provided, an exception is thrown if it is called.
      java.io.Writer setCharacterStream​(long pos)
      This routine is not used by the VTI to read the data, so no implementation is provided, an exception is thrown if it is called.
      int setString​(long pos, java.lang.String str)
      This routine is not used by the VTI to read the data, so no implementation is provided, an exception is thrown if it is called.
      int setString​(long pos, java.lang.String str, 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 it is called.
      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 it is called.
      • Methods inherited from class java.lang.Object

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

      • position

        private long position
      • length

        private long length
      • clobLength

        private long clobLength
      • clobData

        private java.lang.String clobData
    • Constructor Detail

      • ImportClob

        public ImportClob​(ImportLobFile lobFile,
                          long position,
                          long length)
                   throws java.io.IOException
        Create a import Clob 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 clob column data.
        length - length of this clob object data in bytes.
        Throws:
        java.io.IOException
      • ImportClob

        public ImportClob​(java.lang.String data)
        Create a Clob object, whose value is given as string.
        Parameters:
        data - String that contains the clob data.
    • Method Detail

      • length

        public long length()
                    throws java.sql.SQLException
        Returns the number of characters in this CLOB object.
        Specified by:
        length in interface java.sql.Clob
        Returns:
        length of the CLOB in characters
        Throws:
        java.sql.SQLException - on any error.
      • getCharacterStream

        public java.io.Reader getCharacterStream()
                                          throws java.sql.SQLException
        Returns CLOB value designated by this Clob object as a Reader .
        Specified by:
        getCharacterStream in interface java.sql.Clob
        Returns:
        a Reader containing the CLOB data.
        Throws:
        java.sql.SQLException - if any error occurs while setting up this clob data in the import file as Reader.
        See Also:
        Clob
      • getSubString

        public java.lang.String getSubString​(long pos,
                                             int length)
                                      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 it is called.
        Specified by:
        getSubString in interface java.sql.Clob
        Throws:
        java.sql.SQLException
        See Also:
        Clob
      • getAsciiStream

        public java.io.InputStream getAsciiStream()
                                           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 it is called.
        Specified by:
        getAsciiStream in interface java.sql.Clob
        Throws:
        java.sql.SQLException
        See Also:
        Clob
      • position

        public long position​(java.lang.String searchstr,
                             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 it is called.
        Specified by:
        position in interface java.sql.Clob
        Throws:
        java.sql.SQLException
        See Also:
        Clob
      • position

        public long position​(java.sql.Clob searchstr,
                             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 it is called.
        Specified by:
        position in interface java.sql.Clob
        Throws:
        java.sql.SQLException
        See Also:
        Clob
      • setString

        public int setString​(long pos,
                             java.lang.String str)
                      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 it is called.
        Specified by:
        setString in interface java.sql.Clob
        Throws:
        java.sql.SQLException
        See Also:
        Clob
      • setString

        public int setString​(long pos,
                             java.lang.String str,
                             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 it is called.
        Specified by:
        setString in interface java.sql.Clob
        Throws:
        java.sql.SQLException
        See Also:
        Clob
      • setAsciiStream

        public java.io.OutputStream setAsciiStream​(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 it is called.
        Specified by:
        setAsciiStream in interface java.sql.Clob
        Throws:
        java.sql.SQLException
        See Also:
        Clob
      • setCharacterStream

        public java.io.Writer setCharacterStream​(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 it is called.
        Specified by:
        setCharacterStream in interface java.sql.Clob
        Throws:
        java.sql.SQLException
        See Also:
        Clob
      • 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 it is called.
        Specified by:
        truncate in interface java.sql.Clob
        Throws:
        java.sql.SQLException
        See Also:
        Clob
      • getCharacterStream

        public java.io.Reader getCharacterStream​(long pos,
                                                 long length)
                                          throws java.sql.SQLException
        Raise error, not used by import
        Specified by:
        getCharacterStream in interface java.sql.Clob
        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.Clob
        Throws:
        java.sql.SQLException
      • methodNotImplemented

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