Class ImportAbstract

java.lang.Object
org.apache.derby.vti.VTITemplate
org.apache.derby.impl.load.ImportAbstract
All Implemented Interfaces:
AutoCloseable, ResultSet, Wrapper, AwareVTI
Direct Known Subclasses:
Import

abstract class ImportAbstract extends VTITemplate

  • Field Details

    • controlFileReader

      ControlInfo controlFileReader
    • importReadData

      ImportReadData importReadData
    • columnNames

      String[] columnNames
    • numberOfColumns

      int numberOfColumns
    • columnWidths

      int[] columnWidths
    • lineNumber

      int lineNumber
    • nextRow

      String[] nextRow
    • importResultSetMetaData

      ImportResultSetMetaData importResultSetMetaData
    • noOfColumnsExpected

      int noOfColumnsExpected
    • lobsInExtFile

      protected boolean lobsInExtFile
    • tableColumnTypesStr

      String tableColumnTypesStr
    • tableColumnTypes

      int[] tableColumnTypes
    • columnTypeNamesString

      String columnTypeNamesString
    • columnTypeNames

      String[] columnTypeNames
    • udtClassNamesString

      String udtClassNamesString
    • udtClasses

      HashMap udtClasses
    • wasNull

      private boolean wasNull
    • COLUMNNAMEPREFIX

      static final String COLUMNNAMEPREFIX
      See Also:
  • Constructor Details

    • ImportAbstract

      ImportAbstract()
  • Method Details

    • getImportReadData

      abstract ImportReadData getImportReadData() throws Exception
      Throws:
      Exception
    • doAllTheWork

      void doAllTheWork() throws Exception
      Does all the work
      Throws:
      Exception - if there is an error
    • loadColumnNames

      void loadColumnNames()
    • getMetaData

      public ResultSetMetaData getMetaData()
      Gets the resultset meta data
      Specified by:
      getMetaData in interface ResultSet
      Overrides:
      getMetaData in class VTITemplate
      Throws:
      SQLException - if there is an error
    • getRow

      public int getRow() throws SQLException
      gets the next row
      Specified by:
      getRow in interface ResultSet
      Overrides:
      getRow in class VTITemplate
      Throws:
      SQLException - if there is an error
    • getCurrentLineNumber

      public int getCurrentLineNumber()
      gets the current line number
    • next

      public boolean next() throws SQLException
      Throws:
      SQLException
    • close

      public void close() throws SQLException
      closes the resultset
      Throws:
      SQLException - if there is an error
    • wasNull

      public boolean wasNull()
      Specified by:
      wasNull in interface ResultSet
      Overrides:
      wasNull in class VTITemplate
    • getString

      public String getString(int columnIndex) throws SQLException
      Specified by:
      getString in interface ResultSet
      Overrides:
      getString in class VTITemplate
      Throws:
      SQLException - if there is an error
    • getClob

      public Clob getClob(int columnIndex) throws SQLException
      Returns java.sql.Clob type object that contains the column data from the import file.
      Specified by:
      getClob in interface ResultSet
      Overrides:
      getClob in class VTITemplate
      Parameters:
      columnIndex - number of the column. starts at 1.
      Throws:
      SQLException - if any occurs during create of the clob object.
    • getBlob

      public Blob getBlob(int columnIndex) throws SQLException
      Returns java.sql.Blob type object that contains the column data from the import file.
      Specified by:
      getBlob in interface ResultSet
      Overrides:
      getBlob in class VTITemplate
      Parameters:
      columnIndex - number of the column. starts at 1.
      Throws:
      SQLException - if any occurs during create of the blob object.
    • getObject

      public Object getObject(int columnIndex) throws SQLException
      Returns Object that contains the column data from the import file.
      Specified by:
      getObject in interface ResultSet
      Overrides:
      getObject in class VTITemplate
      Parameters:
      columnIndex - number of the column. starts at 1.
      Throws:
      SQLException - if any error occurs.
    • readObject

      public static Object readObject(byte[] bytes) throws Exception
      Read a serializable from a set of bytes.
      Throws:
      Exception
    • destringifyObject

      public static Object destringifyObject(String raw) throws Exception
      Read an object which was serialized to a string using StringUtil
      Throws:
      Exception
    • getBytes

      public byte[] getBytes(int columnIndex) throws SQLException
      Returns byte array that contains the column data from the import file.
      Specified by:
      getBytes in interface ResultSet
      Overrides:
      getBytes in class VTITemplate
      Parameters:
      columnIndex - number of the column. starts at 1.
      Throws:
      SQLException - if any error occurs.
    • isColumnInExtFile

      private boolean isColumnInExtFile(int colIndex)
      Check if for this column type, real data is stored in an external file and only the reference is in the main import file.
      Parameters:
      colIndex - number of the column. starts at 1.
      Returns:
      true, if the column data in a different file from the main import file , otherwise false.
    • importError

      public SQLException importError(Exception ex)
      Close the stream and wrap exception in a SQLException
      Parameters:
      ex - Exception causing the import error
      Throws:
      SQLException