com.knowgate.datacopy
Class DataTblDef

java.lang.Object
  extended by com.knowgate.datacopy.DataTblDef

public class DataTblDef
extends java.lang.Object

Keeps information about each table definition.


Field Summary
 java.lang.String BaseTable
           
 boolean bMayInheritPK
           
 int ColCount
           
 java.lang.String[] ColNames
           
 int[] ColSizes
           
 int[] ColTypes
           
 int cPKs
           
 java.lang.String[] PrimaryKeys
           
 
Constructor Summary
DataTblDef()
           
 
Method Summary
 boolean bestMatch(int iThisCol, DataTblDef oTblDef, int iParentPK)
           
 int findColumnPosition(java.lang.String sColName)
           
 int findColumnType(java.lang.String sColName)
           
 java.lang.String getPrimaryKeys(java.sql.Connection oConn, java.lang.String sSchema, java.lang.String sCatalog, java.lang.String sTable)
          Get table primary key
 boolean inheritsPK(DataTblDef oTblDef)
           
 boolean isPrimaryKey(int iCol)
           
 boolean isPrimaryKey(java.lang.String sCol)
           
 void readMetaData(java.sql.Connection oConn, java.lang.String sTable, java.lang.String sPK)
          Read table metadata
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cPKs

public int cPKs

bMayInheritPK

public boolean bMayInheritPK

PrimaryKeys

public java.lang.String[] PrimaryKeys

ColNames

public java.lang.String[] ColNames

ColTypes

public int[] ColTypes

ColSizes

public int[] ColSizes

ColCount

public int ColCount

BaseTable

public java.lang.String BaseTable
Constructor Detail

DataTblDef

public DataTblDef()
Method Detail

readMetaData

public void readMetaData(java.sql.Connection oConn,
                         java.lang.String sTable,
                         java.lang.String sPK)
                  throws java.sql.SQLException
Read table metadata

Parameters:
oConn - JDBC Connection
sTable - Table Name (case insensitive)
sPK - List of primary key columns delimited by commas
Throws:
java.sql.SQLException

getPrimaryKeys

public java.lang.String getPrimaryKeys(java.sql.Connection oConn,
                                       java.lang.String sSchema,
                                       java.lang.String sCatalog,
                                       java.lang.String sTable)
                                throws java.sql.SQLException
Get table primary key

Parameters:
oConn - JDBC Connection
sSchema - String Schema name
sCatalog - String Catalog Name
sTable - String Table Name (case sensitive)
Returns:
String List of table primary key columns delimited by commas, if table does not have a primary key then return value is null
Throws:
java.sql.SQLException

findColumnPosition

public int findColumnPosition(java.lang.String sColName)

findColumnType

public int findColumnType(java.lang.String sColName)

inheritsPK

public boolean inheritsPK(DataTblDef oTblDef)
                   throws java.lang.ArrayIndexOutOfBoundsException
Throws:
java.lang.ArrayIndexOutOfBoundsException

bestMatch

public boolean bestMatch(int iThisCol,
                         DataTblDef oTblDef,
                         int iParentPK)

isPrimaryKey

public boolean isPrimaryKey(int iCol)

isPrimaryKey

public boolean isPrimaryKey(java.lang.String sCol)