--------------------------------------------------------------------------------
To Run Email demo application from the compiled JAR file run following steps
--------------------------------------------------------------------------------

1. Set KVHOME environment variable to point to the latest home directory of 
   Oracle NoSQL Database binaries.

2. Next from the email sample application home directory change directory 
  to scripts folder.
   
   		$[user@localhost EmailApp]$ cd scripts
   		
3. Now we need to start the kvlite and there is a script here called 
   startKVLite.sh that will delete /tmp/kvroot directory and then use 
   /tmp/kvroot as the -root option. You can modify this simple script file 
   based on your need but it should run as is in any linux environment. 
   Let's run this script first:
   
   		$[user@localhost script]$ /startKVLite.sh
   		Killing Java processes ...
		kill 2899: No such process
		Deleting old kvroot...
		Starting KVLite ...
		nohup: redirecting stderr to stdout
		
4. Wait for 10 seconds and then run java application to create schemas that 
   will be used by the application to store user profile information and email
    messages.  

		$[user@localhost script]$ /createTables.sh				
		===============================================================
		 Successfully Connected to Oracle NoSQL DB @ localhost:
		 5000/kvstore
		===============================================================
		USER table  & emailIndex are created...
		USER.FOLDER table created...
		USER.FOLDER.MESSAGE table created...
		SEQUENCE table  created...
		MESSAGE table created...
		
5. Last step would be to run the email client application and you can do that 
   by running another java application from emailDemo.jar:
   		
		[[user@localhost script]$ ./runEmailApp.sh 
		===============================================================
		  Successfully Connected to Oracle NoSQL DB @ localhost:
		  5000/kvstore
		===============================================================
		
		=============================================================
		What do you want to do?
		1. Show existing accounts
		2. Add new account
		3. Login to your account
		4. Exit
		
		Enter action [1]:  

6. Once you get above command line menu hit 2 to create couple of user accounts
   and after creating accounts login by selecting option 3 to send and receive 
   emails. Remember to login use email account generated by the system for 
   example foo.bar@email.com, where 'foo' is first name and 'bar' is last name.    
   To check the email addresses of all the users you can select option 1 that 
   would show you the details.
 
   If you would like to open the application in Eclipse then import the source 
   code in the Eclipse IDE and to build the latest jar select EmailApp from the 
  'Project Explorer' and right click. You will get the pop window select :
 
       Export > Java > Runnable JAR file > Next > Export
       
  Make sure 'Export Destination' text box has 'EmailApp/bin/emailDemo.jar' as 
  the entry and launch configuration has 'EmailCLI - EmailApp' in the selection 
  box.
       
This would create latest JAR in bin directory.

7. Source code structure follows some Java patterns. The most important package
   is com.oracle.email.dao where all the interaction with tables are 
   implemented. Each table has a dedicated class that begins with the name of 
   the table. Take a look on how CRUD operations are implemented and also see 
   how createTable() method in each class is creating the table.
       
   ~~~~~~~~ Have fun playing with the application. ~~~~~~~~~~~
   
