Chapter 71. Example relational data resource client

71.1. How to run a query over a relational data resource

OGSA-DAI provides a simple command-line client for running requests involving relational data resources. This uses the SQLQuery, TupleToWebRowSetCharArrays, CharArraysResize and DeliverToRequestStatus activities. The query results are pretty-printed.

[Note]Note
OGSA-DAI example clients are intended to allow users to quickly test their deployment as well to provide basic examples of how to construct clients using the client toolkit. They are not intended to be robust applications for use in problem solving. OGSA-DAI offers a toolkit which provides userss with the tools to develop their own clients that use OGSA-DAI services - these clients are the simplest examples built using this toolkit.

The client takes the following arguments:

[Caution]Caution
The client should be run in the $OGSADAI_HOME directory or you should make sure that the directory $OGSADAI_HOME/deploy is in your CLASSPATH (the client-config.wsdd file in that directory is necessary).

71.1. How to run a query over a relational data resource

Run the following, replacing SERVICES-BASE-URL, DATA-RESOURCE-ID, QUERY and, if required DRER-ID.

$ java uk.org.ogsadai.client.toolkit.example.SQLClient \
  -u SERVICES-BASE-URL [-e DRER-ID] -d DATA-RESOURCE-ID  \ 
  -q QUERY

For example:

$ java uk.org.ogsadai.client.toolkit.example.SQLClient \
  -u http://coal.epcc.ed.ac.uk:8080/wsrf/services/dai/ -d MyOwnSQLDataResource \
  -q "SELECT * FROM littleblackbook WHERE id < 10;"