
Example Overview
================

This example shows how to use Speedo, an open source implementation of JDO, via a Resource Adapter.
It's the 'bank' Speedo example and it was copied as it is from the Speedo project.
See
	http://speedo.objectweb.org/
for more information.


Prerequisites
=============

1) Speedo Resource Adapter configuration in JOnAS:
- Check that the 'resource' service is present in the list of the JOnAS services
	(see the jonas.services property in the jonas.properties)
- If JONAS_BASE is using, check that the speedo_for_jonas_ra.rar is present
    cp $JONAS_ROOT/rars/speedo-jdo_for_jonas_ra.rar $JONAS_BASE/rars


2) Speedo configuration:
Update the Speedo configuration
 cp $JONAS_ROOT/conf/speedo-jdo.properties $JONAS_BASE/conf


Building this example
=====================

Under $JONAS_ROOT/examples/jdo, do
	$ ant install


Creating the data structure
===========================

The first time, you must create the tables in the data base used in this example.
For that, you can use a special ant target with some properties setted with correct values:
  $ ant -Dspeedo.dbconf=(${JONAS_BASE}|${JONAS_ROOT})/conf/<your-datasource>.properties
        -Djdbc.driver=<your-jdbc-driver>.jar
        createDataStruct

For example:
  $ ant -Dspeedo.dbconf=$JONAS_BASE/conf/PostgreSQL1.properties  -Djdbc.driver=/usr/share/postgresql/pg74.215.jdbc3.jar  createDataStruct


Running this example
====================
Commands are given for an Unix system, similar commands can be done on Windows.

1) Run a JOnAS server with speedo:
    $ jonas start
	$ jonas admin -a speedo-jdo_for_jonas_ra.rar

2) Load the ejb-jar file of this example
	$ jonas admin -a bank.jar

3) Run the client
	$ jclient -cp $JONAS_BASE/ejbjars/bank.jar:$JONAS_ROOT/lib/commons/jonas/speedo/speedo-jdo_client.jar Client

4) Stop the JOnAS server
	$ jonas stop



