org.apache.derby.impl.load
Class ImportAbstract

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

abstract class ImportAbstract
extends VTITemplate


Field Summary
(package private) static java.lang.String COLUMNNAMEPREFIX
           
(package private)  java.lang.String[] columnNames
           
(package private)  java.lang.String[] columnTypeNames
           
(package private)  java.lang.String columnTypeNamesString
           
(package private)  int[] columnWidths
           
(package private)  ControlInfo controlFileReader
           
(package private)  ImportReadData importReadData
           
(package private)  ImportResultSetMetaData importResultSetMetaData
           
(package private)  int lineNumber
           
protected  boolean lobsInExtFile
           
(package private)  java.lang.String[] nextRow
           
(package private)  int noOfColumnsExpected
           
(package private)  int numberOfColumns
           
(package private)  int[] tableColumnTypes
           
(package private)  java.lang.String tableColumnTypesStr
           
(package private)  java.util.HashMap udtClasses
           
(package private)  java.lang.String udtClassNamesString
           
private  boolean wasNull
           
 
Fields inherited from interface java.sql.ResultSet
CLOSE_CURSORS_AT_COMMIT, CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, HOLD_CURSORS_OVER_COMMIT, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE
 
Constructor Summary
ImportAbstract()
           
 
Method Summary
 void close()
          closes the resultset
static java.lang.Object destringifyObject(java.lang.String raw)
          Read an object which was serialized to a string using StringUtil
(package private)  void doAllTheWork()
          Does all the work
 java.sql.Blob getBlob(int columnIndex)
          Returns java.sql.Blob type object that contains the column data from the import file.
 byte[] getBytes(int columnIndex)
          Returns byte array that contains the column data from the import file.
 java.sql.Clob getClob(int columnIndex)
          Returns java.sql.Clob type object that contains the column data from the import file.
 int getCurrentLineNumber()
          gets the current line number
(package private) abstract  ImportReadData getImportReadData()
           
 java.sql.ResultSetMetaData getMetaData()
          Gets the resultset meta data
 java.lang.Object getObject(int columnIndex)
          Returns Object that contains the column data from the import file.
 int getRow()
          gets the next row
 java.lang.String getString(int columnIndex)
           
 java.sql.SQLException importError(java.lang.Exception ex)
          Close the stream and wrap exception in a SQLException
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.
(package private)  void loadColumnNames()
           
 boolean next()
           
static java.lang.Object readObject(byte[] bytes)
          Read a serializable from a set of bytes.
 boolean wasNull()
           
 
Methods inherited from class org.apache.derby.vti.VTITemplate
absolute, afterLast, beforeFirst, cancelRowUpdates, clearWarnings, deleteRow, findColumn, first, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getCharacterStream, getCharacterStream, getClob, getConcurrency, getCursorName, getDate, getDate, getDate, getDate, getDouble, getDouble, getFetchDirection, getFetchSize, getFloat, getFloat, getInt, getInt, getLong, getLong, getObject, getObject, getObject, getRef, getRef, getShort, getShort, getStatement, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, isAfterLast, isBeforeFirst, isFirst, isLast, last, moveToCurrentRow, moveToInsertRow, previous, refreshRow, relative, rowDeleted, rowInserted, rowUpdated, setFetchDirection, setFetchSize, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateShort, updateShort, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.sql.ResultSet
getHoldability, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getRowId, getRowId, getSQLXML, getSQLXML, isClosed, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBlob, updateBlob, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateClob, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNString, updateNString, updateRowId, updateRowId, updateSQLXML, updateSQLXML
 
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
 

Field Detail

controlFileReader

ControlInfo controlFileReader

importReadData

ImportReadData importReadData

columnNames

java.lang.String[] columnNames

numberOfColumns

int numberOfColumns

columnWidths

int[] columnWidths

lineNumber

int lineNumber

nextRow

java.lang.String[] nextRow

importResultSetMetaData

ImportResultSetMetaData importResultSetMetaData

noOfColumnsExpected

int noOfColumnsExpected

lobsInExtFile

protected boolean lobsInExtFile

tableColumnTypesStr

java.lang.String tableColumnTypesStr

tableColumnTypes

int[] tableColumnTypes

columnTypeNamesString

java.lang.String columnTypeNamesString

columnTypeNames

java.lang.String[] columnTypeNames

udtClassNamesString

java.lang.String udtClassNamesString

udtClasses

java.util.HashMap udtClasses

wasNull

private boolean wasNull

COLUMNNAMEPREFIX

static final java.lang.String COLUMNNAMEPREFIX
See Also:
Constant Field Values
Constructor Detail

ImportAbstract

ImportAbstract()
Method Detail

getImportReadData

abstract ImportReadData getImportReadData()
                                   throws java.lang.Exception
Throws:
java.lang.Exception

doAllTheWork

void doAllTheWork()
            throws java.lang.Exception
Does all the work

Throws:
java.lang.Exception - if there is an error

loadColumnNames

void loadColumnNames()

getMetaData

public java.sql.ResultSetMetaData getMetaData()
Gets the resultset meta data

Throws:
java.sql.SQLException - if there is an error

getRow

public int getRow()
           throws java.sql.SQLException
gets the next row

Specified by:
getRow in interface java.sql.ResultSet
Overrides:
getRow in class VTITemplate
Throws:
java.sql.SQLException - if there is an error
See Also:
ResultSet

getCurrentLineNumber

public int getCurrentLineNumber()
gets the current line number


next

public boolean next()
             throws java.sql.SQLException
Throws:
java.sql.SQLException

close

public void close()
           throws java.sql.SQLException
closes the resultset

Throws:
java.sql.SQLException - if there is an error

wasNull

public boolean wasNull()
Specified by:
wasNull in interface java.sql.ResultSet
Overrides:
wasNull in class VTITemplate
See Also:
ResultSet

getString

public java.lang.String getString(int columnIndex)
                           throws java.sql.SQLException
Specified by:
getString in interface java.sql.ResultSet
Overrides:
getString in class VTITemplate
Throws:
java.sql.SQLException - if there is an error
See Also:
ResultSet

getClob

public java.sql.Clob getClob(int columnIndex)
                      throws java.sql.SQLException
Returns java.sql.Clob type object that contains the column data from the import file.

Specified by:
getClob in interface java.sql.ResultSet
Overrides:
getClob in class VTITemplate
Parameters:
columnIndex - number of the column. starts at 1.
Throws:
java.sql.SQLException - if any occurs during create of the clob object.
See Also:
ResultSet

getBlob

public java.sql.Blob getBlob(int columnIndex)
                      throws java.sql.SQLException
Returns java.sql.Blob type object that contains the column data from the import file.

Specified by:
getBlob in interface java.sql.ResultSet
Overrides:
getBlob in class VTITemplate
Parameters:
columnIndex - number of the column. starts at 1.
Throws:
java.sql.SQLException - if any occurs during create of the blob object.
See Also:
ResultSet

getObject

public java.lang.Object getObject(int columnIndex)
                           throws java.sql.SQLException
Returns Object that contains the column data from the import file.

Specified by:
getObject in interface java.sql.ResultSet
Overrides:
getObject in class VTITemplate
Parameters:
columnIndex - number of the column. starts at 1.
Throws:
java.sql.SQLException - if any error occurs.
See Also:
ResultSet

readObject

public static java.lang.Object readObject(byte[] bytes)
                                   throws java.lang.Exception
Read a serializable from a set of bytes.

Throws:
java.lang.Exception

destringifyObject

public static java.lang.Object destringifyObject(java.lang.String raw)
                                          throws java.lang.Exception
Read an object which was serialized to a string using StringUtil

Throws:
java.lang.Exception

getBytes

public byte[] getBytes(int columnIndex)
                throws java.sql.SQLException
Returns byte array that contains the column data from the import file.

Specified by:
getBytes in interface java.sql.ResultSet
Overrides:
getBytes in class VTITemplate
Parameters:
columnIndex - number of the column. starts at 1.
Throws:
java.sql.SQLException - if any error occurs.
See Also:
ResultSet

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 java.sql.SQLException importError(java.lang.Exception ex)
Close the stream and wrap exception in a SQLException

Parameters:
ex - Exception causing the import error
Throws:
java.sql.SQLException

Built on Thu 2011-03-10 11:54:14+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.