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 (lun, 29 set 2008) $
- Author:
- Stephan Strittmatter (stritti AT users.sourceforge.net), gommma (gommma AT users.sourceforge.net), Last changed by: $Author: gommma $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SqlLoaderControlDataSet
public SqlLoaderControlDataSet(java.lang.String ctlDir,
java.lang.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(java.io.File ctlDir,
java.io.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(java.io.File ctlDir,
java.util.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-2009. All Rights Reserved.