uk.org.ogsadai.client.dbcreate
Class CreateTestDB

java.lang.Object
  |
  +--uk.org.ogsadai.client.dbcreate.CreateTestDB
Direct Known Subclasses:
CreateTestCsvDB, CreateTestDB2DB, CreateTestDerbyDB, CreateTestExistDB, CreateTestMySQLDB, CreateTestOracleDB, CreateTestPostgreSQLDB, CreateTestSQLServerDB, CreateTestXindiceDB

public abstract class CreateTestDB
extends java.lang.Object

This class is extended by the different CreateTest*DB classes which are used to create simple test database tables.

Author:
The OGSA-DAI Project Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
           
protected  DataCreator mData
          Generates the test data.
protected  java.lang.String mDatabase
           
protected  java.lang.String mDBMS
           
protected  java.lang.String mDriver
           
protected  java.lang.String mHost
           
protected  int mNumberOfEntries
           
protected  java.lang.String mPassword
           
protected  java.lang.String mPort
           
protected  java.lang.String mTable
           
protected  java.lang.String mUsername
           
 
Constructor Summary
CreateTestDB(java.lang.String[] args)
          Parse the arguments and populates the test database.
 
Method Summary
protected  void loadDriver()
          Loads the driver class specified by the mDriver instance variable.
protected abstract  void populateDatabase()
          Populates the test database with the test data.
protected  void printUsage()
          Prints the general usage instructions for a CreateTestDB client.
protected  void printVariables(java.lang.String prefix)
          Displays the settings prefixed by the specified string.
protected abstract  void setDefaultSettings()
          Sets the default settings for the client.
protected  boolean setupArguments(java.lang.String[] args)
          Parses the arguments general to most CreateTestDB clients.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
See Also:
Constant Field Values

mData

protected final DataCreator mData
Generates the test data.


mDBMS

protected java.lang.String mDBMS

mDriver

protected java.lang.String mDriver

mHost

protected java.lang.String mHost

mPort

protected java.lang.String mPort

mDatabase

protected java.lang.String mDatabase

mUsername

protected java.lang.String mUsername

mPassword

protected java.lang.String mPassword

mTable

protected java.lang.String mTable

mNumberOfEntries

protected int mNumberOfEntries
Constructor Detail

CreateTestDB

public CreateTestDB(java.lang.String[] args)
Parse the arguments and populates the test database. Displays an error message if the arguments are invalid or an error arises while creating the test database.

Parameters:
args - the arguments passed to the client's main method.
Method Detail

setDefaultSettings

protected abstract void setDefaultSettings()
Sets the default settings for the client.


populateDatabase

protected abstract void populateDatabase()
                                  throws CreateTestDatabaseException
Populates the test database with the test data.

CreateTestDatabaseException

setupArguments

protected boolean setupArguments(java.lang.String[] args)
Parses the arguments general to most CreateTestDB clients. This method may be overridden if a client requires special argument parsing.

Parameters:
args - the argument string
Returns:
true if the arguments are parsed correctly, otherwise false

printUsage

protected void printUsage()
Prints the general usage instructions for a CreateTestDB client. This may be overridden if a client requires special usage.


printVariables

protected void printVariables(java.lang.String prefix)
Displays the settings prefixed by the specified string.

Parameters:
prefix - the displayed settings begin with "prefix Settings:"

loadDriver

protected void loadDriver()
                   throws CreateTestDatabaseException
Loads the driver class specified by the mDriver instance variable.

Throws:
CreateTestDatabaseException - if there is a problem loading the driver