1. Create a datasource
----------------------
1a. Create the app database
createdb -h 127.0.0.1 -p 5432 -U rhqadmin app

1b. Copy postgresql-8.3-603.jdbc3.jar from jon-server-xxx/jbossas/server/default/lib to jboss/server2/lib

1c. restart server2

1d. In the JBossON GUI, click the "Browse resources" link, choose server2, Inventory tab.
In the "Child resources" section, below the list, there is a "Create New" dropdown list.
Choose "New DataSource". Click the "ok" button.
Choose "Default template" on next screen.
Fill next screen with the following values :
      Name : AppDataSource
      jndi-name : AppDS
      connection-url : jdbc:postgresql://127.0.0.1:5432/app
      driver-class : org.postgresql.Driver
      user-name : rhqadmin
      password : rhqadmin
      transaction-isolation : TRANSACTION_READ_COMMITTED
      min-pool-size : 5
      max-pool-size : 20
      blocking-timeout-millis : 30000
      idle-timeout-minutes : 15
      prepared-statement-cache-size :75


2. Deploy the Simple Application
--------------------------------
The simple application contains only one page : the product list and a form to create a new one.
The Product object is a JPA object saved to the "app" Postgres database through Hibernate.

In the JBossON GUI, click the "Browse resources" link, choose server2, Inventory tab.
In the "Child resources" section, below the list, there is a "Create New" dropdown list.
Choose "New EAR". Click the "ok" button.
Fill next screen with the following values :
	Name : jbosson-simple
	Package : jboss-simple.ear
	Upload : jboss-simple-lab3.ear (provided)

3. Check the application
------------------------
In the browser, load the following url : http://localhost:8082/SimpleApp/index.do
Add some products
Check the database contents : psql -h 127.0.0.1 -p 5432 -U rhqadmin app
Then : select * from Product;

4. Move the database
--------------------
4a. Create the app2 database
createdb -h 127.0.0.1 -p 5432 -U rhqadmin app2

4b. Link AppDS to app2 database
In the JBossON GUI, click the "Browse resources" link, choose server2, Inventory tab.
Filter resources, choose "datasources".
Pickup AppDS, configure Tab, click the "Edit" button.
Change the line :  connection-url : jdbc:postgresql://127.0.0.1:5432/app2
Click the "Save" button at the page bottom.

4c. Check the application
Replay step 3, checking new products in the "app2" database instead of the "app" one.