uk.org.ogsadai.client.dbcreate
Class CreateTestPostgreSQLDB

java.lang.Object
  |
  +--uk.org.ogsadai.client.dbcreate.CreateTestDB
        |
        +--uk.org.ogsadai.client.dbcreate.CreateTestPostgreSQLDB

public class CreateTestPostgreSQLDB
extends CreateTestDB

This program will create and populate a PostgreSQL database table called littleblackbook and populate it with 10,000 address entries consisting of a name (First, Surname). Address and telephone number.

The numberOfEntries field may be modified to generate a table with any desired number of rows. The nth row in each possible database will be identical across each one which has at least n rows (assuming Random is implemented the same on all Java jdks).

Usage: java uk.org.ogsadai.client.dbcreate.CreateTestPostgreSQLDB [-driverclass PostgreSQLDriverClass] [-host PostgreSQLHostName] [-port PostgreSQLPortNumber] [-database PostgreSQLDatabaseName] [-username PostgreSQLUserName] [-password PostgreSQLPassword] [-tablename NameOfTableToCreate] [-rows NumberOfRowsToCreate] [-connectionUrl ConnectionUrl] [-drop] Default Settings: PostgreSQLDriverClass: org.postgresql.Driver PostgreSQLHostName: localhost PostgreSQLPortNumber: 5432 PostgreSQLDatabaseName: ogsadai PostgreSQLUserName: ogsadai PostgreSQLPassword: ogsadai NameOfTableToCreate: littleblackbook NumberOfRowsToCreate: 10000 If the connection URL is provided it will override the hostname, port number and database name settings.

Author:
The OGSA-DAI Project Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
           
private  java.lang.String mConnectionUrl
           
private  boolean mDrop
           
 
Fields inherited from class uk.org.ogsadai.client.dbcreate.CreateTestDB
mData, mDatabase, mDBMS, mDriver, mHost, mNumberOfEntries, mPassword, mPort, mTable, mUsername
 
Constructor Summary
CreateTestPostgreSQLDB(java.lang.String[] args)
          Creates and populates a PostgreSQL test database table according to the specified settings or the default settings if no arguments are used.
 
Method Summary
static void main(java.lang.String[] args)
          Entry point for this program.
protected  void populateDatabase()
          Populates the test database with the test data.
protected  void printUsage()
          Displays the settings prefixed by the specified string.
protected  void printVariables(java.lang.String prefix)
          Displays the settings prefixed by the specified string.
protected  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 uk.org.ogsadai.client.dbcreate.CreateTestDB
loadDriver
 
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

mDrop

private boolean mDrop

mConnectionUrl

private java.lang.String mConnectionUrl
Constructor Detail

CreateTestPostgreSQLDB

public CreateTestPostgreSQLDB(java.lang.String[] args)
Creates and populates a PostgreSQL test database table according to the specified settings or the default settings if no arguments are used.

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

main

public static void main(java.lang.String[] args)
Entry point for this program.

Parameters:
args - See class documentation.

setDefaultSettings

protected void setDefaultSettings()
Description copied from class: CreateTestDB
Sets the default settings for the client.

Specified by:
setDefaultSettings in class CreateTestDB

populateDatabase

protected void populateDatabase()
                         throws CreateTestDatabaseException
Description copied from class: CreateTestDB
Populates the test database with the test data.

Specified by:
populateDatabase in class CreateTestDB
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.

Overrides:
setupArguments in class CreateTestDB
Parameters:
args - the argument string
Returns:
true if the arguments are parsed correctly, otherwise false

printVariables

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

Overrides:
printVariables in class CreateTestDB
Parameters:
prefix - the displayed settings begin with "prefix Settings:"

printUsage

protected void printUsage()
Displays the settings prefixed by the specified string.

Overrides:
printUsage in class CreateTestDB