java.lang.AutoCloseable
, java.sql.ResultSet
, java.sql.Wrapper
, AwareVTI
public class Import extends ImportAbstract
VTITemplate.ColumnDescriptor
Modifier and Type | Field | Description |
---|---|---|
private static int |
_importCounter |
|
private static java.util.Hashtable<java.lang.Integer,Import> |
_importers |
|
private java.lang.String |
inputFileName |
|
private static short |
skip |
COLUMNNAMEPREFIX, columnNames, columnTypeNames, columnTypeNamesString, columnWidths, controlFileReader, importReadData, importResultSetMetaData, lineNumber, lobsInExtFile, nextRow, noOfColumnsExpected, numberOfColumns, tableColumnTypes, tableColumnTypesStr, udtClasses, udtClassNamesString
Constructor | Description |
---|---|
Import(java.lang.String inputFileName,
java.lang.String columnDelimiter,
java.lang.String characterDelimiter,
java.lang.String codeset,
int noOfColumnsExpected,
java.lang.String columnTypes,
boolean lobsInExtFile,
int importCounter,
java.lang.String columnTypeNames,
java.lang.String udtClassNamesString) |
Constructor to Invoke Import from a select statement
|
Modifier and Type | Method | Description |
---|---|---|
private static int |
bumpImportCounter() |
|
private void |
doImport() |
|
private static java.sql.SQLException |
formatImportError(Import importer,
java.lang.String inputFile,
java.lang.Throwable t) |
|
(package private) ImportReadData |
getImportReadData() |
virtual method from the abstract class
|
static void |
importData(java.sql.Connection connection,
java.lang.String schemaName,
java.lang.String tableName,
java.lang.String insertColumnList,
java.lang.String columnIndexes,
java.lang.String inputFileName,
java.lang.String columnDelimiter,
java.lang.String characterDelimiter,
java.lang.String codeset,
short replace,
boolean lobsInExtFile,
short... extraArgs) |
SYSCS_IMPORT_DATA system Procedure from ij or from a Java application
invokes this method to perform import to a table from a file.
|
static void |
importTable(java.sql.Connection connection,
java.lang.String schemaName,
java.lang.String tableName,
java.lang.String inputFileName,
java.lang.String columnDelimiter,
java.lang.String characterDelimiter,
java.lang.String codeset,
short replace,
boolean lobsInExtFile,
short... extraArgs) |
SYSCS_IMPORT_TABLE system Procedure from ij or from a Java application
invokes this method to perform import to a table from a file.
|
private static void |
performImport(java.sql.Connection connection,
java.lang.String schemaName,
java.lang.String insertColumnList,
java.lang.String columnIndexes,
java.lang.String tableName,
java.lang.String inputFileName,
java.lang.String columnDelimiter,
java.lang.String characterDelimiter,
java.lang.String codeset,
short replace,
boolean lobsInExtFile) |
|
private static java.lang.String |
quoteStringArgument(java.lang.String string) |
Quote a string argument so that it can be used as a literal in an
SQL statement.
|
private static java.lang.String[] |
readHeaders(java.lang.String inputFileName,
java.lang.String characterDelimiter,
java.lang.String columnDelimiter,
java.lang.String codeset) |
close, destringifyObject, doAllTheWork, getBlob, getBytes, getClob, getCurrentLineNumber, getMetaData, getObject, getRow, getString, importError, loadColumnNames, next, readObject, wasNull
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
updateObject, updateObject, updateObject, updateObject
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
private static int _importCounter
private static java.util.Hashtable<java.lang.Integer,Import> _importers
private java.lang.String inputFileName
private static short skip
public Import(java.lang.String inputFileName, java.lang.String columnDelimiter, java.lang.String characterDelimiter, java.lang.String codeset, int noOfColumnsExpected, java.lang.String columnTypes, boolean lobsInExtFile, int importCounter, java.lang.String columnTypeNames, java.lang.String udtClassNamesString) throws java.sql.SQLException
inputFileName
- The URL of the ASCII file from which import will happenjava.sql.SQLException
- on errorprivate void doImport() throws java.lang.Exception
java.lang.Exception
public static void importTable(java.sql.Connection connection, java.lang.String schemaName, java.lang.String tableName, java.lang.String inputFileName, java.lang.String columnDelimiter, java.lang.String characterDelimiter, java.lang.String codeset, short replace, boolean lobsInExtFile, short... extraArgs) throws java.sql.SQLException
connection
- The Derby database connection URL for the database containing the tableschemaName
- The name of the schema where table to import existstableName
- Name of the Table the data has to be imported to.inputFileName
- Name of the file from which data has to be imported.columnDelimiter
- Delimiter that seperates columns in the filecharacterDelimiter
- Delimiter that is used to quiote non-numeric typescodeset
- Codeset of the data in the filereplace
- Indicates whether the data in table has to be replaced or
appended.(0 - append , > 0 Replace the data)lobsInExtFile
- true, if the lobs data is stored in an external file,
and the reference to it is stored in the main import file.java.sql.SQLException
- on errorspublic static void importData(java.sql.Connection connection, java.lang.String schemaName, java.lang.String tableName, java.lang.String insertColumnList, java.lang.String columnIndexes, java.lang.String inputFileName, java.lang.String columnDelimiter, java.lang.String characterDelimiter, java.lang.String codeset, short replace, boolean lobsInExtFile, short... extraArgs) throws java.sql.SQLException
connection
- The Derby database connection URL for the database containing the tableschemaName
- The name of the schema where table to import existstableName
- Name of the Table the data has to be imported to.insertColumnList
- Comma Seperated column name list to which data
has to be imported from file.eg: 'c2,c2,'c3'.columnIndexes
- Comma sepearted Lit Index of the columns in the file(first column
starts at 1). eg: '3 ,4 , 5'inputFileName
- Name of the file from which data has to be imported.columnDelimiter
- Delimiter that seperates columns in the filecharacterDelimiter
- Delimiter that is used to quiote non-numeric typescodeset
- Codeset of the data in the filereplace
- Indicates whether the data in table has to be replaced or
appended.(0 - append , > 0 Replace the data)lobsInExtFile
- true, if the lobs data is stored in an external file,
and the reference is stored in the main import file.java.sql.SQLException
- on errorsprivate static void performImport(java.sql.Connection connection, java.lang.String schemaName, java.lang.String insertColumnList, java.lang.String columnIndexes, java.lang.String tableName, java.lang.String inputFileName, java.lang.String columnDelimiter, java.lang.String characterDelimiter, java.lang.String codeset, short replace, boolean lobsInExtFile) throws java.sql.SQLException
java.sql.SQLException
private static java.lang.String[] readHeaders(java.lang.String inputFileName, java.lang.String characterDelimiter, java.lang.String columnDelimiter, java.lang.String codeset) throws java.sql.SQLException
java.sql.SQLException
ImportReadData getImportReadData() throws java.lang.Exception
getImportReadData
in class ImportAbstract
java.lang.Exception
- on errorprivate static int bumpImportCounter()
private static java.sql.SQLException formatImportError(Import importer, java.lang.String inputFile, java.lang.Throwable t)
private static java.lang.String quoteStringArgument(java.lang.String string)
null
an SQL NULL token
is returned.string
- a string or null
null
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.