org.apache.derby.impl.load
Class ColumnInfo

java.lang.Object
  extended byorg.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.

Author:
suresht

Field Summary
private  java.util.ArrayList columnPositions
           
private  java.util.ArrayList columnTypes
           
private  java.sql.Connection conn
           
private  boolean createolumnNames
           
private  int expectedNumberOfCols
           
private  java.util.ArrayList insertColumnNames
           
private  int noOfColumns
           
private  java.lang.String schemaName
           
private  java.lang.String tableName
           
private  java.util.ArrayList vtiColumnNames
           
 
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
 
Method Summary
 java.lang.String getColumnNamesWithCasts()
           
 int getExpectedNumberOfColumnsInFile()
           
 java.lang.String getInsertColumnNames()
           
private  java.lang.String getTypeOption(java.lang.String type, int length, int precision, int scale)
           
static boolean importExportSupportedType(int type)
           
private  boolean initializeColumnInfo(java.lang.String columnPattern)
           
private  boolean tableExists()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vtiColumnNames

private java.util.ArrayList vtiColumnNames

insertColumnNames

private java.util.ArrayList insertColumnNames

columnTypes

private java.util.ArrayList columnTypes

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
Constructor Detail

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 queries
sName - - table's schema
tName - - table Name
vtiColumnPrefix - - Prefix to use to generate column names to select from VTI
Throws:
java.lang.Exception - on error
java.sql.SQLException
Method Detail

initializeColumnInfo

private boolean initializeColumnInfo(java.lang.String columnPattern)
                              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)

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

Built on Tue 2006-10-10 19:23:47+0200, from revision exported

Apache Derby V10.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.