Class ImportReadData
java.lang.Object
org.apache.derby.impl.load.ImportReadData
- All Implemented Interfaces:
PrivilegedExceptionAction<Object>
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final intprivate BufferedReaderprotected Stringprotected String[]private int[]protected ControlInfoprivate char[]private intprotected String(package private) static final intprotected char[]private charprotected intprivate booleanprotected char[](package private) intprotected intprotected char[](package private) intprotected intprotected Stringprivate int(package private) boolean(package private) booleanprivate booleanprotected booleanprivate booleanprivate String(package private) intprivate ImportLobFile[]private Stringprivate intprivate longprotected Stringprivate intprotected int(package private) int(package private) intprotected char[]private charprotected intprivate booleanprivate intprivate shortprivate static final int(package private) int(package private) booleanprivate char[](package private) int -
Constructor Summary
ConstructorsConstructorDescriptionImportReadData(String inputFileName, ControlInfo controlFileReader, short skipLines) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate void(package private) voidclose the input data file(package private) int(package private) BlobgetBlobColumnFromExtFile(String lobLocationStr, int colIndex) Returns a blob columnn data stored at the specified location as a java.sql.Blob object.(package private) ClobgetClobColumnFromExtFile(String lobLocationStr, int colIndex) Returns a clob columnn data stored at the specified location as a java.sql.Clob object.(package private) StringgetClobColumnFromExtFileAsString(String lobLocationStr, int colIndex) Returns a clob columnn data stored at the specified location.(package private) intreturns the number of the current row(package private) intprotected voidif columndefinition is true, ignore first row.protected voidif skipHeaderLines is greater than 0, ignore skipHeaderLines number of lines.private voidinitExternalLobFile(String lobLocationStr, int colIndex) Extract the file name, offset and length from the given lob location and setup the file resources to read the data from the file on first invocaton.private booleanisFieldSep(char[] chrArray) protected voidload the column types from the meta data line to be analyzed later in the constructor of the ImportResultSetMetaData.private voidprivate voidprivate intlookForPassedSeparator(char[] delimiter, int delimiterIndex, int delimiterLength, int nextChar, boolean lookForRecordSeperator) private voidprivate voidopenFile()private booleanreadNextDelimitedRow(String[] returnStringArray) private booleanreadNextFixedRow(String[] returnStringArray) (package private) booleanreadNextRow(String[] returnStringArray) the way we read the next row from input file depends on it's format(package private) booleanreadNextToken(char[] delimiter, int delimiterIndex, int delimiterLength, boolean isRecordSeperator) (package private) booleanprivate voidprivate intreCheckRestOfTheCharacters(int startFrom, char[] delimiter, int delimiterLength) final Objectrun()private booleanskipDoubleDelimiters(char[] characterDelimiter)
-
Field Details
-
inputFileName
-
skipLines
private short skipLines -
columnWidths
private int[] columnWidths -
rowWidth
private int rowWidth -
tempString
private char[] tempString -
numberOfCharsReadSoFar
private int numberOfCharsReadSoFar -
bufferedReader
-
START_SIZE
private static final int START_SIZE- See Also:
-
currentToken
private char[] currentToken -
currentTokenMaxSize
private int currentTokenMaxSize -
foundStartDelimiter
boolean foundStartDelimiter -
totalCharsSoFar
int totalCharsSoFar -
positionOfNonWhiteSpaceCharInFront
int positionOfNonWhiteSpaceCharInFront -
positionOfNonWhiteSpaceCharInBack
int positionOfNonWhiteSpaceCharInBack -
lineNumber
int lineNumber -
fieldStartDelimiterIndex
int fieldStartDelimiterIndex -
fieldStopDelimiterIndex
int fieldStopDelimiterIndex -
stopDelimiterPosition
int stopDelimiterPosition -
foundStartAndStopDelimiters
boolean foundStartAndStopDelimiters -
streamOpenForReading
boolean streamOpenForReading -
DEFAULT_FORMAT_CODE
static final int DEFAULT_FORMAT_CODE- See Also:
-
ASCII_FIXED_FORMAT_CODE
static final int ASCII_FIXED_FORMAT_CODE- See Also:
-
formatCode
private int formatCode -
hasColumnDefinition
private boolean hasColumnDefinition -
recordSeparatorChar0
private char recordSeparatorChar0 -
fieldSeparatorChar0
private char fieldSeparatorChar0 -
recordSepStartNotWhite
private boolean recordSepStartNotWhite -
fieldSepStartNotWhite
private boolean fieldSepStartNotWhite -
controlFileReader
-
numberOfColumns
protected int numberOfColumns -
columnTypes
-
fieldSeparator
protected char[] fieldSeparator -
fieldSeparatorLength
protected int fieldSeparatorLength -
recordSeparator
protected char[] recordSeparator -
recordSeparatorLength
protected int recordSeparatorLength -
nullString
-
columnDefinition
-
format
-
dataCodeset
-
fieldStartDelimiter
protected char[] fieldStartDelimiter -
fieldStartDelimiterLength
protected int fieldStartDelimiterLength -
fieldStopDelimiter
protected char[] fieldStopDelimiter -
fieldStopDelimiterLength
protected int fieldStopDelimiterLength -
hasDelimiterAtEnd
protected boolean hasDelimiterAtEnd -
lobFileHandles
-
lobFileName
-
lobOffset
private long lobOffset -
lobLength
private int lobLength -
haveSep
private boolean haveSep
-
-
Constructor Details
-
ImportReadData
ImportReadData(String inputFileName, ControlInfo controlFileReader, short skipLines) throws Exception - Throws:
Exception
-
-
Method Details
-
loadPropertiesInfo
-
getNumberOfColumns
int getNumberOfColumns() -
ignoreFirstRow
-
ignoreHeaderLines
-
loadColumnTypes
-
openFile
-
run
-
realOpenFile
-
loadMetaData
-
closeStream
-
findNumberOfColumnsInARow
-
checkForWhiteSpaceInFront
private void checkForWhiteSpaceInFront() -
checkForWhiteSpaceInBack
private void checkForWhiteSpaceInBack() -
readTokensUntilEndOfRecord
-
lookForPassedSeparator
private int lookForPassedSeparator(char[] delimiter, int delimiterIndex, int delimiterLength, int nextChar, boolean lookForRecordSeperator) throws IOException - Throws:
IOException
-
reCheckRestOfTheCharacters
private int reCheckRestOfTheCharacters(int startFrom, char[] delimiter, int delimiterLength) -
skipDoubleDelimiters
- Throws:
IOException
-
omitLineFeed
- Throws:
IOException
-
getCurrentRowNumber
int getCurrentRowNumber()returns the number of the current row -
readNextRow
-
readNextFixedRow
-
readNextDelimitedRow
-
isFieldSep
private boolean isFieldSep(char[] chrArray) -
readNextToken
-
getClobColumnFromExtFileAsString
Returns a clob columnn data stored at the specified location.- Parameters:
lobLocationStr- location of the clob data.colIndex- number of the column. starts at 1.- Throws:
SQLException- on any errors.
-
getClobColumnFromExtFile
Returns a clob columnn data stored at the specified location as a java.sql.Clob object.- Parameters:
lobLocationStr- location of the clob data.colIndex- number of the column. starts at 1.- Throws:
SQLException- on any errors.
-
getBlobColumnFromExtFile
Returns a blob columnn data stored at the specified location as a java.sql.Blob object.- Parameters:
lobLocationStr- location of the clob data.colIndex- number of the column. starts at 1.- Throws:
SQLException- on any errors.
-
initExternalLobFile
Extract the file name, offset and length from the given lob location and setup the file resources to read the data from the file on first invocaton.- Parameters:
lobLocationStr- location of the clob data.colIndex- number of the column. starts at 1.- Throws:
SQLException- on any errors.
-