Class SqlLoaderControlDataSet

java.lang.Object
org.dbunit.dataset.AbstractDataSet
org.dbunit.dataset.CachedDataSet
org.dbunit.dataset.sqlloader.SqlLoaderControlDataSet
All Implemented Interfaces:
IDataSet, IDataSetConsumer

public class SqlLoaderControlDataSet extends CachedDataSet implements IDataSet
This class constructs an IDataSet given a directory containing control files. It handles translations of "null"(the string), into null.

Example usage:

 File ctlDir = new File("src/sqlloader");
 File orderedTablesFile = new File("src/sqlloader/tables.lst");
 IDataSet dataSet = new SqlLoaderControlDataSet(ctlDir, orderedTablesFile);
 
The file orderedTablesFile must contain the names of the tables to be imported. As a convention the .ctl file must have the same name as the table names file. Here an example of the "tables.lst" file:
LANGUAGE
COUNTRY
The ctlDir directory must then contain the files COUNTRY.ctl and LANGUAGE.ctl.

Since:
2.4.0
Version:
$Revision$ $Date$
Author:
Stephan Strittmatter (stritti AT users.sourceforge.net), gommma (gommma AT users.sourceforge.net), Last changed by: $Author$
  • Constructor Details

    • SqlLoaderControlDataSet

      public SqlLoaderControlDataSet(String ctlDir, String orderedTablesFile) throws DataSetException
      The Constructor.
      Parameters:
      ctlDir - the control files directory
      orderedTablesFile - the table order file
      Throws:
      DataSetException - the data set exception
    • SqlLoaderControlDataSet

      public SqlLoaderControlDataSet(File ctlDir, File orderedTablesFile) throws DataSetException
      The Constructor.
      Parameters:
      ctlDir - the control files directory
      orderedTablesFile - the table order file
      Throws:
      DataSetException - the data set exception
    • SqlLoaderControlDataSet

      public SqlLoaderControlDataSet(File ctlDir, List orderedTableNames) throws DataSetException
      The Constructor.
      Parameters:
      ctlDir - the control files directory
      orderedTableNames - a list of strings that contains the ordered table names
      Throws:
      DataSetException - the data set exception