com.knowgate.hipergate.datamodel
Class TableLoader

java.lang.Object
  extended by com.knowgate.dataobjs.DBTable
      extended by com.knowgate.hipergate.datamodel.TableLoader
All Implemented Interfaces:
ImportLoader

public class TableLoader
extends DBTable
implements ImportLoader

Generic text to table loader


Field Summary
 
Fields inherited from interface com.knowgate.hipergate.datamodel.ImportLoader
LOOUKP_TR_COLUMNS, LOOUKP_TR_COUNT, MODE_APPEND, MODE_APPENDUPDATE, MODE_UPDATE, WRITE_LOOKUPS
 
Constructor Summary
TableLoader(java.lang.String sTableName)
           
 
Method Summary
 void close()
          Close ImportLoader Must be always called before ImportLoader is destroyed
 java.lang.String[] columnNames()
          Get array of column names
 short[] columnTypes()
           
 java.lang.Object get(int iColumnIndex)
          Get current value for a column given its index
 java.lang.Object get(java.lang.String sColumnName)
          Get current value for a column given its name
 void prepare(java.sql.Connection oConn, ColumnList oColList)
          Prepare ImportLoader for repeated execution
 void put(int iColumnIndex, java.lang.Object oValue)
          Put current value for a column
 void put(int iColumnIndex, java.lang.String sValue)
           
 void put(java.lang.String sColumnName, java.lang.Object oValue)
          Put current value for a column
 void setAllColumnsToNull()
          Set all current values to null
 void store(java.sql.Connection oConn, java.lang.String sWorkArea, int iFlags)
          Store a single row or a set of related rows
 
Methods inherited from class com.knowgate.dataobjs.DBTable
columnCount, deleteRegister, existsRegister, existsRegister, existsRegister, getCatalog, getColumnByName, getColumnIndex, getColumns, getColumnsStr, getIndexes, getName, getPrimaryKey, getSchema, hashCode, loadRegister, readColumns, setCatalog, setSchema, storeRegister, storeRegisterLong
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.knowgate.hipergate.datamodel.ImportLoader
columnCount, getColumnIndex
 

Constructor Detail

TableLoader

public TableLoader(java.lang.String sTableName)
Method Detail

columnNames

public java.lang.String[] columnNames()
                               throws java.lang.IllegalStateException
Description copied from interface: ImportLoader
Get array of column names

Specified by:
columnNames in interface ImportLoader
Returns:
String[]
Throws:
java.lang.IllegalStateException

columnTypes

public short[] columnTypes()
                    throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

prepare

public void prepare(java.sql.Connection oConn,
                    ColumnList oColList)
             throws java.sql.SQLException
Description copied from interface: ImportLoader
Prepare ImportLoader for repeated execution

Specified by:
prepare in interface ImportLoader
Parameters:
oConn - Connection
oColList - ColumnList List of columns that will be inserted or updated at the database
Throws:
java.sql.SQLException

get

public java.lang.Object get(int iColumnIndex)
                     throws java.lang.ArrayIndexOutOfBoundsException
Description copied from interface: ImportLoader
Get current value for a column given its index

Specified by:
get in interface ImportLoader
Parameters:
iColumnIndex - int [0..columnCount()-1]
Returns:
Object
Throws:
java.lang.ArrayIndexOutOfBoundsException

get

public java.lang.Object get(java.lang.String sColumnName)
                     throws java.lang.ArrayIndexOutOfBoundsException
Description copied from interface: ImportLoader
Get current value for a column given its name

Specified by:
get in interface ImportLoader
Parameters:
sColumnName - Case insensitive String
Returns:
Object
Throws:
java.lang.ArrayIndexOutOfBoundsException - if no column with such name was found

put

public void put(int iColumnIndex,
                java.lang.String sValue)
         throws java.lang.NumberFormatException,
                java.lang.ArrayIndexOutOfBoundsException,
                java.text.ParseException
Throws:
java.lang.NumberFormatException
java.lang.ArrayIndexOutOfBoundsException
java.text.ParseException

put

public void put(int iColumnIndex,
                java.lang.Object oValue)
         throws java.lang.ArrayIndexOutOfBoundsException
Description copied from interface: ImportLoader
Put current value for a column

Specified by:
put in interface ImportLoader
Parameters:
iColumnIndex - int [0..columnCount()-1]
oValue - Object
Throws:
java.lang.ArrayIndexOutOfBoundsException

put

public void put(java.lang.String sColumnName,
                java.lang.Object oValue)
         throws java.lang.ArrayIndexOutOfBoundsException
Description copied from interface: ImportLoader
Put current value for a column

Specified by:
put in interface ImportLoader
Parameters:
sColumnName - String Column name
oValue - Object
Throws:
java.lang.ArrayIndexOutOfBoundsException

setAllColumnsToNull

public void setAllColumnsToNull()
Description copied from interface: ImportLoader
Set all current values to null

Specified by:
setAllColumnsToNull in interface ImportLoader

close

public void close()
           throws java.sql.SQLException
Description copied from interface: ImportLoader

Close ImportLoader

Must be always called before ImportLoader is destroyed

Specified by:
close in interface ImportLoader
Throws:
java.sql.SQLException

store

public void store(java.sql.Connection oConn,
                  java.lang.String sWorkArea,
                  int iFlags)
           throws java.sql.SQLException,
                  java.lang.IllegalArgumentException,
                  java.lang.NullPointerException
Description copied from interface: ImportLoader
Store a single row or a set of related rows

Specified by:
store in interface ImportLoader
Parameters:
oConn - Connection
sWorkArea - String
iFlags - int
Throws:
java.sql.SQLException
java.lang.IllegalArgumentException
java.lang.NullPointerException