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
-
Nested Class Summary
Nested classes/interfaces inherited from class VTITemplate
VTITemplate.ColumnDescriptor -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final String(package private) String[](package private) String[](package private) String(package private) int[](package private) ControlInfo(package private) ImportReadData(package private) ImportResultSetMetaData(package private) intprotected boolean(package private) String[](package private) int(package private) int(package private) int[](package private) String(package private) HashMap(package private) Stringprivate booleanFields inherited from interface 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()closes the resultsetstatic ObjectdestringifyObject(String raw) Read an object which was serialized to a string using StringUtil(package private) voidDoes all the workgetBlob(int columnIndex) Returnsjava.sql.Blobtype 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.getClob(int columnIndex) Returnsjava.sql.Clobtype object that contains the column data from the import file.intgets the current line number(package private) abstract ImportReadDataGets the resultset meta datagetObject(int columnIndex) Returns Object that contains the column data from the import file.intgetRow()gets the next rowgetString(int columnIndex) importError(Exception ex) Close the stream and wrap exception in a SQLExceptionprivate booleanisColumnInExtFile(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) voidbooleannext()static ObjectreadObject(byte[] bytes) Read a serializable from a set of bytes.booleanwasNull()Methods inherited from class 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, getContext, getCursorName, getDate, getDate, getDate, getDate, getDouble, getDouble, getFetchDirection, getFetchSize, getFloat, getFloat, getHoldability, getInt, getInt, getLong, getLong, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getObject, getRef, getRef, getReturnTableSignature, getRowId, getRowId, getShort, getShort, getSQLXML, getSQLXML, getStatement, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, isAfterLast, isBeforeFirst, isClosed, isFirst, isLast, isWrapperFor, last, moveToCurrentRow, moveToInsertRow, notImplemented, previous, refreshRow, relative, rowDeleted, rowInserted, rowUpdated, setContext, setFetchDirection, setFetchSize, unwrap, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateClob, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNString, updateNString, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateRowId, updateRowId, updateShort, updateShort, updateSQLXML, updateSQLXML, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestampMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ResultSet
updateObject, updateObject, updateObject, updateObject
-
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
- See Also:
-
-
Constructor Details
-
ImportAbstract
ImportAbstract()
-
-
Method Details
-
getImportReadData
- Throws:
Exception
-
doAllTheWork
-
loadColumnNames
void loadColumnNames() -
getMetaData
Gets the resultset meta data- Specified by:
getMetaDatain interfaceResultSet- Overrides:
getMetaDatain classVTITemplate- Throws:
SQLException- if there is an error
-
getRow
gets the next row- Specified by:
getRowin interfaceResultSet- Overrides:
getRowin classVTITemplate- Throws:
SQLException- if there is an error
-
getCurrentLineNumber
public int getCurrentLineNumber()gets the current line number -
next
- Throws:
SQLException
-
close
closes the resultset- Throws:
SQLException- if there is an error
-
wasNull
public boolean wasNull()- Specified by:
wasNullin interfaceResultSet- Overrides:
wasNullin classVTITemplate
-
getString
- Specified by:
getStringin interfaceResultSet- Overrides:
getStringin classVTITemplate- Throws:
SQLException- if there is an error
-
getClob
Returnsjava.sql.Clobtype object that contains the column data from the import file.- Specified by:
getClobin interfaceResultSet- Overrides:
getClobin classVTITemplate- Parameters:
columnIndex- number of the column. starts at 1.- Throws:
SQLException- if any occurs during create of the clob object.
-
getBlob
Returnsjava.sql.Blobtype object that contains the column data from the import file.- Specified by:
getBlobin interfaceResultSet- Overrides:
getBlobin classVTITemplate- Parameters:
columnIndex- number of the column. starts at 1.- Throws:
SQLException- if any occurs during create of the blob object.
-
getObject
Returns Object that contains the column data from the import file.- Specified by:
getObjectin interfaceResultSet- Overrides:
getObjectin classVTITemplate- Parameters:
columnIndex- number of the column. starts at 1.- Throws:
SQLException- if any error occurs.
-
readObject
-
destringifyObject
-
getBytes
Returns byte array that contains the column data from the import file.- Specified by:
getBytesin interfaceResultSet- Overrides:
getBytesin classVTITemplate- 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
Close the stream and wrap exception in a SQLException- Parameters:
ex- Exception causing the import error- Throws:
SQLException
-