org.apache.derby.impl.load
Class ColumnInfo
java.lang.Object
org.apache.derby.impl.load.ColumnInfo
class ColumnInfo
- extends java.lang.Object
This class provides supportto create casting/conversions required to
perform import. Import VTI gives all the data in VARCHAR type becuase data
in the files is in CHAR format. There is no implicit cast availabile from
VARCHAR to some of the types. In cases where explicit casting is allowed,
columns are casted with explict cast to the type of table column; in case of
double/real explicit casting is also not allowd , scalar fuction DOUBLE is
used in those cases.
Constructor Summary |
ColumnInfo(java.sql.Connection conn,
java.lang.String sName,
java.lang.String tName,
java.lang.String insertColumnList,
java.lang.String vtiColumnIndexes,
java.lang.String vtiColumnPrefix)
Initialize the column type and name information |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
vtiColumnNames
private java.util.ArrayList vtiColumnNames
insertColumnNames
private java.util.ArrayList insertColumnNames
columnTypes
private java.util.ArrayList columnTypes
jdbcColumnTypes
private java.util.ArrayList jdbcColumnTypes
noOfColumns
private int noOfColumns
columnPositions
private java.util.ArrayList columnPositions
createolumnNames
private boolean createolumnNames
expectedNumberOfCols
private int expectedNumberOfCols
conn
private java.sql.Connection conn
tableName
private java.lang.String tableName
schemaName
private java.lang.String schemaName
udtClassNames
private java.util.HashMap udtClassNames
ColumnInfo
public ColumnInfo(java.sql.Connection conn,
java.lang.String sName,
java.lang.String tName,
java.lang.String insertColumnList,
java.lang.String vtiColumnIndexes,
java.lang.String vtiColumnPrefix)
throws java.sql.SQLException
- Initialize the column type and name information
- Parameters:
conn
- - connection to use for metadata queriessName
- - table's schematName
- - table NameinsertColumnList
- - comma seperared insert statement column listvtiColumnIndexes
- - Indexes in the filevtiColumnPrefix
- - Prefix to use to generate column names to select from VTI
- Throws:
java.lang.Exception
- on error
java.sql.SQLException
initializeColumnInfo
private boolean initializeColumnInfo(java.lang.String columnPattern)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
getUDTClassName
private java.lang.String getUDTClassName(java.sql.DatabaseMetaData dmd,
java.lang.String sqlTypeName)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
importExportSupportedType
public static final boolean importExportSupportedType(int type)
getTypeOption
private java.lang.String getTypeOption(java.lang.String type,
int length,
int precision,
int scale)
getColumnTypeNames
public java.lang.String getColumnTypeNames()
throws java.lang.Exception
- Get the column type names.
- Throws:
java.lang.Exception
getUDTClassNames
public java.lang.String getUDTClassNames()
throws java.lang.Exception
- Get the class names of udt columns as a string.
- Throws:
java.lang.Exception
getColumnNamesWithCasts
public java.lang.String getColumnNamesWithCasts()
getInsertColumnNames
public java.lang.String getInsertColumnNames()
getExpectedNumberOfColumnsInFile
public int getExpectedNumberOfColumnsInFile()
tableExists
private boolean tableExists()
throws java.sql.SQLException
- Throws:
java.sql.SQLException
getExpectedVtiColumnTypesAsString
public java.lang.String getExpectedVtiColumnTypesAsString()
getExpectedVtiColumnTypes
public static int[] getExpectedVtiColumnTypes(java.lang.String columnTypesStr,
int noOfColumns)
getExpectedColumnTypeNames
public static java.lang.String[] getExpectedColumnTypeNames(java.lang.String columnTypeNamesString,
int noOfColumns)
throws java.lang.Exception
- Throws:
java.lang.Exception
getExpectedUDTClasses
public static java.util.HashMap getExpectedUDTClasses(java.lang.String stringVersion)
throws java.lang.Exception
- Throws:
java.lang.Exception
deserializeHashMap
public static java.util.HashMap deserializeHashMap(java.lang.String stringVersion)
throws java.lang.Exception
- Throws:
java.lang.Exception
Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.