org.dbunit.dataset.sqlloader
Class SqlLoaderControlDataSet

java.lang.Object
  extended by org.dbunit.dataset.AbstractDataSet
      extended by org.dbunit.dataset.CachedDataSet
          extended by 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: 817 $ $Date: 2008-09-29 22:23:35 +0200 (Mon, 29 Sep 2008) $
Author:
Stephan Strittmatter (stritti AT users.sourceforge.net), gommma (gommma AT users.sourceforge.net), Last changed by: $Author: gommma $

Constructor Summary
SqlLoaderControlDataSet(File ctlDir, File orderedTablesFile)
          The Constructor.
SqlLoaderControlDataSet(File ctlDir, List orderedTableNames)
          The Constructor.
SqlLoaderControlDataSet(String ctlDir, String orderedTablesFile)
          The Constructor.
 
Method Summary
 
Methods inherited from class org.dbunit.dataset.CachedDataSet
createIterator, endDataSet, endTable, row, startDataSet, startTable
 
Methods inherited from class org.dbunit.dataset.AbstractDataSet
createTableNameMap, getTable, getTableMetaData, getTableNames, getTables, isCaseSensitiveTableNames, iterator, reverseIterator, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.dbunit.dataset.IDataSet
getTable, getTableMetaData, getTableNames, getTables, isCaseSensitiveTableNames, iterator, reverseIterator
 

Constructor Detail

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


Copyright © 2002-2012. All Rights Reserved.