|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--uk.org.ogsadai.client.dbcreate2.CreateTestDB
|
+--uk.org.ogsadai.client.dbcreate2.CreateTestDerbyDB
CreateTestDerbyDB.java
This program will populate three tables in a Derby database
called example_{traveller,destination,booking} and populate
them with a total of 40,000 entries.
The mNumberOfEntries 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.CreateTestDerbyDB [-driverclass DerbyDriverClass]
[-database DerbyDatabasePath]
[-username DerbyUserName] [-password DerbyPassword]
[-tablename NameOfTableToCreate] [-rows NumberOfRowsToCreate]
Default Settings:
DerbyDriverClass: org.apache.derby.jdbc.EmbeddedDriver
DerbyDatabaseName: C:/Downloads/Derby/ogsadai
DerbyUserName: ogsadai
DerbyPassword: ogsadai
NameOfTableToCreate: littleblackbook
NumberOfRowsToCreate: 10000
| Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICE
|
| Fields inherited from class uk.org.ogsadai.client.dbcreate2.CreateTestDB |
mBookingTable, mData, mDatabase, mDBMS, mDestinationTable, mDriver, mHost, mNumberOfBookings, mNumberOfDestinations, mNumberOfTravellers, mPassword, mPort, mRows, mSizeOfBlob, mTablePrefix, mTravellerTable, mUsername |
| Constructor Summary | |
CreateTestDerbyDB(java.lang.String[] args)
Creates and populates a Derby test database table according to the specified settings or the default settings if no arguments are used. |
|
| Method Summary | |
protected void |
dropTableIfExists(java.sql.Connection connection,
java.lang.String tablename)
Drops the specified table. |
protected java.sql.Connection |
getConnection()
Returns a java.sql.Connection data resource. |
static void |
main(java.lang.String[] args)
|
protected void |
printUsage()
Prints the general usage instructions for a CreateTestDerbyDB 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)
Parses the arguments for CreateTestDerbyDB clients. |
| Methods inherited from class uk.org.ogsadai.client.dbcreate2.CreateTestDB |
createBookingTable, createDestinationTable, createTravellerTable, getCreateBookingTableStatement, getCreateDestinationTableStatement, getCreateTravellerTableStatement, loadDriver, populateDatabase |
| 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
| Constructor Detail |
public CreateTestDerbyDB(java.lang.String[] args)
args - arguments passed to the main method.| Method Detail |
protected void setDefaultSettings()
CreateTestDB
setDefaultSettings in class CreateTestDBprotected boolean setupArguments(java.lang.String[] args)
setupArguments in class CreateTestDBargs - the argument string
protected void printUsage()
printUsage in class CreateTestDBprotected void printVariables(java.lang.String prefix)
printVariables in class CreateTestDBprefix - the displayed settings begin with "prefix
Settings:"public static void main(java.lang.String[] args)
protected java.sql.Connection getConnection()
throws java.sql.SQLException
CreateTestDBjava.sql.Connection data resource.
getConnection in class CreateTestDBjava.sql.SQLException
protected void dropTableIfExists(java.sql.Connection connection,
java.lang.String tablename)
throws java.sql.SQLException
CreateTestDB
dropTableIfExists in class CreateTestDBconnection - a connection to the data resourcetablename - the name of the table to be created
java.sql.SQLException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||