OGSA-DAI contains a set of simple clients to create test data. These do not use OGSA-DAI - they talk directly to the database. These clients are for users who do not have their own data but want to explore OGSA-DAI.
If you already have data then please skip on to Chapter 36, Deploy Globus Toolkit.
You should already have the database driver JARs for your database. If not then we listed suitable drivers earlier in Chapter 27, Data resource products and you should get them now.
You should put the database driver JARs into the following directory:
$OGSADAI_HOME/thirdparty/lib
You'll now need to add the JARs to your
CLASSPATH.
If running under Solaris or Linux run the following command for each
driver JAR you have, remembering to
replacedatabase.jar with the name of
your database JAR each time.
$ export CLASSPATH=$OGSADAI_HOME/thirdparty/lib/database.jar:$CLASSPATH
If running under Windows run the following command for each driver JAR
you have, remembering to
replacedatabase.jar with the name of
your database JAR each time.
$ set CLASSPATH=%OGSADAI_HOME%\thirdparty\lib\database.jar;$CLASSPATH
OGSA-DAI provides simple clients to create a test database table
called littleblackbook which contains
four columns:
id - unique ID (key) of type
INTEGER.
name - first and surname of
type VARCHAR(64).
address - address of
type VARCHAR(128).
phone telephone number of
type VARCHAR(20).
The number of entries in the table can be chosen by you - the default
is 10000 - as can the table name - the default is
littleblackbook and driver class name.
-tablename option e.g. adding the
argument -tablename myTable would
ensure the new table is called
myTable-rows option e.g. adding the
argument -rows 100 would
ensure the new table has 100 rows.
-driverclass option e.g. adding the
argument -driverclass my.own.Driver would
ensure the client uses the driver
my.own.Driver
Run the following from the command-line, remembering to replace
HOST,
PORT,
DATABASE,
USER and
PASSWORD with the host, port, login
name and password of your database:
$ java uk.org.ogsadai.dbcreate.CreateTestDB2DB -host HOST -port PORT -database DATABASE -username USER -password PASSWORD
e.g.
$ java uk.org.ogsadai.dbcreate.CreateTestDB2DB -host coal.epcc.ed.ac.uk -port 5000 -database ogsadai -username db2user -password 123456
Run the following from the command-line, remembering to replace
HOST,
PORT,
DATABASE,
USER and
PASSWORD with the host, port, login
name and password of your database:
$ java uk.org.ogsadai.dbcreate.CreateTestMySQLDB -host HOST -port PORT -database DATABASE -username USER -password PASSWORD
e.g.
$ java uk.org.ogsadai.dbcreate.CreateTestMySQLDB -host coal.epcc.ed.ac.uk -port 3306 -database ogsadai -username mysqlUser -password 123456
If you don't have a test database then this client will create one if
you give it two more arguments -
rootusername and
rootuserpassword. For example:
$ java uk.org.ogsadai.dbcreate.CreateTestMySQLDB -host coal.epcc.ed.ac.uk -port 3306 -database ogsadai -username mysqlUser -password 123456 -rootusername ogsadairootuser -rootpassword ogsadairootpassword
will connect to MySQL using
rootusername, create a database called
ogsadai, create a user
mysqlUser with password
123456 and then create the
littleblackbook table.
Run the following from the command-line, remembering to replace
HOST,
PORT,
DATABASE,
USER and
PASSWORD with the host, port, login
name and password of your database:
$ java uk.org.ogsadai.dbcreate.CreateTestOracleDB -host HOST -port PORT -database DATABASE -username USER -password PASSWORD
e.g.
$ java uk.org.ogsadai.dbcreate.CreateTestOracleDB -host coal.epcc.ed.ac.uk -port 1521 -database ogsadai -username oracleUser -password 123456
Run the following from the command-line, remembering to replace
HOST,
PORT,
DATABASE,
USER and
PASSWORD with the host, port, login
name and password of your database:
$ java uk.org.ogsadai.dbcreate.CreateTestPostgreSQLDB -host HOST -port PORT -database DATABASE -username USER -password PASSWORD
e.g.
$ java uk.org.ogsadai.dbcreate.CreateTestPostgreSQLDB -host coal.epcc.ed.ac.uk -port 1521 -database ogsadai -username postgresUser -password 123456
Run the following from the command-line, remembering to replace
HOST,
PORT,
DATABASE,
USER and
PASSWORD with the host, port, login
name and password of your database:
$ java uk.org.ogsadai.dbcreate.CreateTestSQLServerDB -host HOST -port PORT -database DATABASE -username USER -password PASSWORD
e.g.
$ java uk.org.ogsadai.dbcreate.CreateTestSQLServerDB -host coal.epcc.ed.ac.uk -port 1433 -database ogsadai -username sqlServerUser -password 123456
OGSA-DAI provides a simple client to create a test XMLDB collection
called littleblackbook which contains
documents of the following format:
<entry id="ID"> <name>NAME</name> <address>ADDRESS</address> <phone>PHONE</phone> </entry>
The number of documents in the collection can be chosen by you. The default is 10000. Entries are randomly created.
The number of documents in the collection can be chosen by you - the
default is 10000 - as can the collection name - the default is
littleblackbook and driver class
name.
-collectionname option e.g. adding the
argument -collectionname myCollection
would ensure the new table is called
myCollection-documents option e.g. adding the
argument -documents 100 would
ensure the new collection has 100 documents.
-driverclass option e.g. adding the
argument -driverclass my.own.Driver would
ensure the client uses the driver
my.own.Driver
Run the following from the command-line, remembering to replace
HOST,
PORT,
DATABASE,
with the host, port and database name of your database:
$ java uk.org.ogsadai.dbcreate.CreateTestExistDB -host HOST -port PORT -database DATABASE
e.g.
$ java uk.org.ogsadai.dbcreate.CreateTestExistDB -host coal.epcc.ed.ac.uk -port 8080 -database db
The default eXist username is admin
with an empty password. You can create a username and password
for as follows:
http://coal.epcc.ed.ac.uk:8080/exist
admin user name and
no password.
ogsadaiogsadaiguest/db/littleblackbookFor more information on configuring eXist logins see: http://exist.sourceforge.net/security.html
If you have a full eXist download you could use their Java client. This is in the eXist installation directory and can be run using
$ ./bin/client.sh
You should update the connection URL with your host and port number then you can use the Tools=>Edit Users menu option to add more users.
For more information using the eXist client see: http://exist.sourceforge.net/client.html