net.sourceforge.addam.impexp
Class ExportDataTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.apache.tools.ant.taskdefs.JDBCTask
              extended by net.sourceforge.addam.impexp.ExportDataTask

public class ExportDataTask
extends org.apache.tools.ant.taskdefs.JDBCTask


Field Summary
private  String catalog
           
protected  File dir
           
private  List<Tables> excludes
           
private  List<Tables> includes
           
private  String schema
           
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
ExportDataTask()
           
 
Method Summary
 void addExcludeTables(Tables tables)
           
 void addIncludeTables(Tables tables)
           
 void execute()
          Selects all data from the named tables and extracts to the named files.
 void exportTable(String tableName, Connection connection)
          Selects all data from the named table and extracts to the named file.
protected  List<String> getTableNames()
          returns all Tables included by not excluded
 void setCatalog(String catalog)
           
 void setDir(File tableDir)
           
 void setExcludeFile(File tableFile)
          this is a shortcut for having a subelement by simply providing a filename as an attribute to this task
 void setExcludes(String names)
           
 void setExcludesPattern(String pattern)
           
 void setIncludeFile(File tableFile)
          this is a shortcut for having an subelement by simply providing a filename as an attribute to this task
 void setIncludes(String names)
           
 void setIncludesPattern(String pattern)
           
 void setSchema(String schema)
           
 
Methods inherited from class org.apache.tools.ant.taskdefs.JDBCTask
createClasspath, getClasspath, getConnection, getLoader, getLoaderMap, getPassword, getRdbms, getUrl, getUserId, getVersion, isAutocommit, isCaching, isValidRdbms, setAutocommit, setCaching, setClasspath, setClasspathRef, setDriver, setPassword, setRdbms, setUrl, setUserid, setVersion
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

includes

private final List<Tables> includes

excludes

private final List<Tables> excludes

dir

protected File dir

schema

private String schema

catalog

private String catalog
Constructor Detail

ExportDataTask

public ExportDataTask()
Method Detail

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Selects all data from the named tables and extracts to the named files.

Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException - if anything goes wrong

exportTable

public void exportTable(String tableName,
                        Connection connection)
                 throws org.apache.tools.ant.BuildException
Selects all data from the named table and extracts to the named file.

Throws:
org.apache.tools.ant.BuildException - if anything goes wrong

setIncludeFile

public void setIncludeFile(File tableFile)
this is a shortcut for having an subelement by simply providing a filename as an attribute to this task

Parameters:
tableFile - a file containing an ordered list of tables

setExcludeFile

public void setExcludeFile(File tableFile)
this is a shortcut for having a subelement by simply providing a filename as an attribute to this task

Parameters:
tableFile - a file containing an ordered list of tables

setIncludesPattern

public void setIncludesPattern(String pattern)
Parameters:
pattern - a regexp pattern to compare table names to

setExcludesPattern

public void setExcludesPattern(String pattern)
Parameters:
pattern - a regexp pattern to compare table names to

setIncludes

public void setIncludes(String names)
Parameters:
names - a comma separated list of table names

setExcludes

public void setExcludes(String names)
Parameters:
names - a comma separated list of table names

addIncludeTables

public void addIncludeTables(Tables tables)
Parameters:
tables - a set of tables to include or exclude

addExcludeTables

public void addExcludeTables(Tables tables)
Parameters:
tables - a set of tables to include or exclude

setDir

public void setDir(File tableDir)
Parameters:
tableDir - the directory to write the files into

setSchema

public void setSchema(String schema)

setCatalog

public void setCatalog(String catalog)

getTableNames

protected List<String> getTableNames()
returns all Tables included by not excluded

Returns:
List of Strings each naming a table


Copyright © 2005-2006 ADDAM Project Team. All Rights Reserved.