Package org.apache.derby.impl.load
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 org.apache.derby.vti.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) int
protected boolean
(package private) String[]
(package private) int
(package private) int
(package private) int[]
(package private) String
(package private) HashMap
(package private) String
private boolean
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
closes the resultsetstatic Object
destringifyObject
(String raw) Read an object which was serialized to a string using StringUtil(package private) void
Does all the workgetBlob
(int columnIndex) Returnsjava.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.getClob
(int columnIndex) Returnsjava.sql.Clob
type object that contains the column data from the import file.int
gets the current line number(package private) abstract ImportReadData
Gets the resultset meta datagetObject
(int columnIndex) Returns Object that contains the column data from the import file.int
getRow()
gets the next rowgetString
(int columnIndex) importError
(Exception ex) Close the stream and wrap exception in a SQLExceptionprivate 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
boolean
next()
static 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, 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, 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
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
Does all the work- Throws:
Exception
- if there is an error
-
loadColumnNames
void loadColumnNames() -
getMetaData
Gets the resultset meta data- Specified by:
getMetaData
in interfaceResultSet
- Overrides:
getMetaData
in classVTITemplate
- Throws:
SQLException
- if there is an error
-
getRow
gets the next row- Specified by:
getRow
in interfaceResultSet
- Overrides:
getRow
in 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:
wasNull
in interfaceResultSet
- Overrides:
wasNull
in classVTITemplate
-
getString
- Specified by:
getString
in interfaceResultSet
- Overrides:
getString
in classVTITemplate
- Throws:
SQLException
- if there is an error
-
getClob
Returnsjava.sql.Clob
type object that contains the column data from the import file.- Specified by:
getClob
in interfaceResultSet
- Overrides:
getClob
in classVTITemplate
- Parameters:
columnIndex
- number of the column. starts at 1.- Throws:
SQLException
- if any occurs during create of the clob object.
-
getBlob
Returnsjava.sql.Blob
type object that contains the column data from the import file.- Specified by:
getBlob
in interfaceResultSet
- Overrides:
getBlob
in 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:
getObject
in interfaceResultSet
- Overrides:
getObject
in classVTITemplate
- Parameters:
columnIndex
- number of the column. starts at 1.- Throws:
SQLException
- if any error occurs.
-
readObject
Read a serializable from a set of bytes.- Throws:
Exception
-
destringifyObject
Read an object which was serialized to a string using StringUtil- Throws:
Exception
-
getBytes
Returns byte array that contains the column data from the import file.- Specified by:
getBytes
in interfaceResultSet
- Overrides:
getBytes
in 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
-