|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.client.dbcreate.CreateTestDB | +--uk.org.ogsadai.client.dbcreate.CreateTestMySQLDB
This program will create a new MySQL database containing a new table called littleblackbook and populate it with 10,000 address entries consisting of a name (First, Surname). Address and telephone number.
The rootusername
and rootpassword
will be used
to connect to the MySQL system database, where the new database will be
created if it does not already exist, and the user specified will be created
if it does not already exist. If the MySQL system database cannot be connected
to, this program will attempt to connect to the database specified anyway, to
try to create the new table.
The rows
parameter 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.CreateTestMySQLDB [-driverclass MySQLDriverClass] [-host MySQLHostName] [-database MySQLDatabaseName] [-username MySQLUserName] [-password MySQLPassword] [-tablename NameOfTableToCreate] [-rows NumberOfRowsToCreate] [-rootusername MySQLRootUserName] [-rootpassword MySQLRootPassword] Default Settings: MySQLDriverClass: org.gjt.mm.mysql.Driver MySQLHostName: localhost MySQLDatabaseName: ogsadai MySQLUserName: ogsadai MySQLPassword: ogsadai NameOfTableToCreate: littleblackbook NumberOfRowsToCreate: 10000 MySQLRootUserName: root MySQLRootPassword:
Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICE
|
private java.lang.String |
mRootPassword
|
private java.lang.String |
mRootUsername
|
Fields inherited from class uk.org.ogsadai.client.dbcreate.CreateTestDB |
mData, mDatabase, mDBMS, mDriver, mHost, mNumberOfEntries, mPassword, mPort, mTable, mUsername |
Constructor Summary | |
CreateTestMySQLDB(java.lang.String[] args)
Creates and populates a MySQL 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)
|
protected 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 void |
setDefaultSettings()
Sets the default settings for the client. |
protected boolean |
setupArguments(java.lang.String[] args)
Overrides the setupArguments method in CreateTestDB |
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 |
private static final java.lang.String COPYRIGHT_NOTICE
private java.lang.String mRootUsername
private java.lang.String mRootPassword
Constructor Detail |
public CreateTestMySQLDB(java.lang.String[] args)
args
- arguments passed to the main method.Method Detail |
public static void main(java.lang.String[] args)
protected void setDefaultSettings()
CreateTestDB
setDefaultSettings
in class CreateTestDB
protected void populateDatabase() throws CreateTestDatabaseException
CreateTestDB
populateDatabase
in class CreateTestDB
CreateTestDatabaseException
protected boolean setupArguments(java.lang.String[] args)
setupArguments
in class CreateTestDB
args
- the argument string
protected void printVariables(java.lang.String prefix)
printVariables
in class CreateTestDB
prefix
- the displayed settings begin with "prefix
Settings:"protected void printUsage()
CreateTestDB
printUsage
in class CreateTestDB
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |