org.vivoweb.harvester.util
Class DatabaseClone

java.lang.Object
  extended by org.vivoweb.harvester.util.DatabaseClone

public class DatabaseClone
extends java.lang.Object

Clone a database from one jdbc connection to another

Author:
Christopher Haines (hainesc@ctrip.ufl.edu)

Constructor Summary
DatabaseClone(ArgList argList)
          Constructor
DatabaseClone(java.sql.Connection inputConn, java.lang.String inputFile, java.sql.Connection outputConn, java.lang.String outputFile, java.lang.String[] tableNames, java.lang.String[] tableTypes, java.util.Map<java.lang.String,java.lang.String> dbUnitFeatures)
          Constructor
DatabaseClone(java.lang.String[] args)
          Constructor
 
Method Summary
 void execute()
          Clone a database
static void main(java.lang.String... args)
          Main method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseClone

public DatabaseClone(java.sql.Connection inputConn,
                     java.lang.String inputFile,
                     java.sql.Connection outputConn,
                     java.lang.String outputFile,
                     java.lang.String[] tableNames,
                     java.lang.String[] tableTypes,
                     java.util.Map<java.lang.String,java.lang.String> dbUnitFeatures)
              throws org.apache.commons.vfs.FileSystemException,
                     org.dbunit.DatabaseUnitException
Constructor

Parameters:
inputConn - database to input from
inputFile - use this database state file as the input database
outputConn - database to output to
outputFile - output the state of the input database in this file
tableNames - list of tables to export (null exports all)
tableTypes - list of table types to export (null exports 'TABLE' type only)
dbUnitFeatures - map of DBUnit features to boolean strings "true"/"false"
Throws:
org.apache.commons.vfs.FileSystemException - error resolving file
org.dbunit.DatabaseUnitException - error connecting to database

DatabaseClone

public DatabaseClone(java.lang.String[] args)
              throws java.io.IOException,
                     java.lang.ClassNotFoundException,
                     java.sql.SQLException,
                     org.dbunit.DatabaseUnitException
Constructor

Parameters:
args - commandline arguments
Throws:
java.io.IOException - error creating task
java.lang.ClassNotFoundException - error loading driver
java.sql.SQLException - error connecting to database
org.dbunit.DatabaseUnitException - error connecting to database

DatabaseClone

public DatabaseClone(ArgList argList)
              throws java.lang.ClassNotFoundException,
                     java.sql.SQLException,
                     org.apache.commons.vfs.FileSystemException,
                     org.dbunit.DatabaseUnitException
Constructor

Parameters:
argList - option set of parsed args
Throws:
java.lang.ClassNotFoundException - error loading driver
java.sql.SQLException - error connecting to database
org.apache.commons.vfs.FileSystemException - error resolving file
org.dbunit.DatabaseUnitException - error connecting to database
Method Detail

execute

public void execute()
             throws java.sql.SQLException,
                    org.dbunit.DatabaseUnitException,
                    java.io.IOException
Clone a database

Throws:
java.sql.SQLException - error connecting
org.dbunit.DatabaseUnitException - error
java.io.IOException - error resolving connections

main

public static void main(java.lang.String... args)
Main method

Parameters:
args - commandline arguments