Setting Up a Test Database

Many of the examples cited within this user guide, in addition to example Perform documents provided within OGSA-DAI/examples and the OGSA-DAI system tests, work with an example database table called littleblackbook. In this page we tell you how to configure your database so that you can use our examples.

Create an ogsadai Database

You should first set up a database within your database management system with the name ogsadai. This should ideally be given an associated username of ogsadai and password of ogsadai.

If your database management system does not support usernames and passwords then that is OK.

Your database management system instructions or your database administrator should be able to provide instructions as to how to do this.

Create a littleblackbook Table

Having created an ogsadai database you now need to create littleblackbook table.

We provide a number of clients that you can use to build the table, depending upon your database management system.

Common Arguments

Each client takes the following (optional) arguments:

To see a client's options and default settings:

$ java uk.org.ogsadai.client.dbcreate.CLIENT -help

For example:

$ java uk.org.ogsadai.client.dbcreate.CreateTestMySQLDB -help

MySQL - CreateTestMySQLDB Client

The CreateTestMySQLDB Client also supports the creation of the database itself, as well as the creation and population of the table within it. This can be invoked by the use of the following additional arguments:

To create a database and a table use, for example:

$ java uk.org.ogsadai.client.dbcreate.CreateTestMySQLDB
  -host localhost -port 3306 -database ogsadai -username ogsadai
  -password ogsadai -tablename littleblackbook -rows 1000000
  -rootusername root -rootpassword passwd

Xindice - CreateTestXindiceDB Client

To create a database table use, for example:

$ java uk.org.ogsadai.client.dbcreate.CreateTestXindiceDB
  -host localhost -port 4080 -database ogsadai
  -collectionname littleblackbook -documents 1000000

DB2 - CreateTestDB2DB Client

To create a database table use, for example:

$ java uk.org.ogsadai.client.dbcreate.CreateTestDB2DB
  -host localhost -port 50000 -database ogsadai -username ogsadai
  -password ogsadai -tablename littleblackbook -rows 1000000

Oracle - CreateTestOracleDB Client

To create a database table use, for example:

$ java uk.org.ogsadai.client.dbcreate.CreateTestOracleDB
  -host localhost -port 1521 -database ogsadai -username ogsadai
  -password ogsadai -tablename littleblackbook -rows 1000000

PostgreSQL - CreateTestPostgreSQLDB Client

To create a database table use, for example:

$ java uk.org.ogsadai.client.dbcreate.CreateTestPostgreSQLDB
  -host localhost -port 5432 -database ogsadai -username ogsadai
  -password ogsadai -tablename littleblackbook -rows 1000000

SQL Server - CreateTestSQLServerDB Client

To create a database table use, for example:

$ java uk.org.ogsadai.client.dbcreate.CreateTestSQLServerDB
  -host localhost -port 1433 -database ogsadai -username ogsadai
  -password ogsadai -tablename littleblackbook -rows 1000000

Derby - CreateTestDerbyDB Client

Note that host name and port number arguments are not applicable. Also note the database argument denotes the path to the database. To create a database table use, for example:

$ java uk.org.ogsadai.client.dbcreate.CreateTestDerbyDB
  -database c:/downloads/derby/ogsadai -username ogsadai
  -password ogsadai -tablename littleblackbook -rows 1000000

NOTE: OGSA-DAI does not provide support for Apache Derby, although it is a tested platform. Support is planned when Derby emerges from the incubator phase of the Apache process.

File containing comma-separated values - CreateTestCsvDB Client

This client creates a file containing comma-separated values. To create a table use:

$ java uk.org.ogsadai.client.dbcreate.CreateTestCsvDB
  -directory DIRECTORY-FOR-FILE -filename CSV-FILE-NAME
  -delimiter CSV-DELIMITER -rows ROWS
  -tablename littleblackbook -rows 1000000

For example:

$ java uk.org.ogsadai.client.dbcreate.CreateTestCsvDB
  -directory . -filename MyCSVFile.csv -delimiter "," -rows 100000
  -tablename littleblackbook -rows 1000000