Class ImportClob

java.lang.Object
org.apache.derby.impl.load.ImportClob
All Implemented Interfaces:
Clob

class ImportClob extends Object implements 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.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private String
     
    private long
     
    private long
     
     
    private long
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    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

    Modifier and Type
    Method
    Description
    void
    Raise error, not used by import
    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.
    Returns CLOB value designated by this Clob object as a Reader .
    getCharacterStream(long pos, long length)
    Raise error, not used by import
    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
    Returns the number of characters in this CLOB object.
    private SQLException
    Return an unimplemented feature error
    long
    position(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(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.
    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.
    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, 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, 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 Details

    • lobFile

      private ImportLobFile lobFile
    • position

      private long position
    • length

      private long length
    • clobLength

      private long clobLength
    • clobData

      private String clobData
  • Constructor Details

    • ImportClob

      public ImportClob(ImportLobFile lobFile, long position, long length) throws 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:
      IOException
    • ImportClob

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

    • length

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

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

      public String getSubString(long pos, int length) throws 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 Clob
      Throws:
      SQLException
      See Also:
    • getAsciiStream

      public InputStream getAsciiStream() throws 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 Clob
      Throws:
      SQLException
      See Also:
    • position

      public long position(String searchstr, long start) throws 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 Clob
      Throws:
      SQLException
      See Also:
    • position

      public long position(Clob searchstr, long start) throws 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 Clob
      Throws:
      SQLException
      See Also:
    • setString

      public int setString(long pos, String str) throws 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 Clob
      Throws:
      SQLException
      See Also:
    • setString

      public int setString(long pos, String str, int offset, int len) throws 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 Clob
      Throws:
      SQLException
      See Also:
    • setAsciiStream

      public OutputStream setAsciiStream(long pos) throws 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 Clob
      Throws:
      SQLException
      See Also:
    • setCharacterStream

      public Writer setCharacterStream(long pos) throws 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 Clob
      Throws:
      SQLException
      See Also:
    • truncate

      public void truncate(long len) throws 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 Clob
      Throws:
      SQLException
      See Also:
    • getCharacterStream

      public Reader getCharacterStream(long pos, long length) throws SQLException
      Raise error, not used by import
      Specified by:
      getCharacterStream in interface Clob
      Throws:
      SQLException
    • free

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

      private SQLException methodNotImplemented()
      Return an unimplemented feature error