org.dbunit.dataset.sqlloader
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:
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 $
SqlLoaderControlDataSet
public SqlLoaderControlDataSet(String ctlDir,
String orderedTablesFile)
throws DataSetException
- The Constructor.
- Parameters:
ctlDir
- the control files directoryorderedTablesFile
- 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 directoryorderedTablesFile
- 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 directoryorderedTableNames
- a list of strings that contains the ordered table names
- Throws:
DataSetException
- the data set exception
Copyright © 2002-2012. All Rights Reserved.