This directory contains jdbc samples for Real Time Messaging.

1.- Installation
    ------------

    Jdbc samples make use of stored procedures located in the
    
    	$SYBASE/$SYBASE_ASE/samples/messaging/sql

    directory.  Refer to README file in that directory for more information on
    installation of the sql samples.

    Most of jdbc samples extend the class named msg_main, which is defined
    in msg_main.java. Be sure to have the current directory
    
    	$SYBASE/$SYBASE_ASE/samples/messaging/jdbc

    in CLASSPATH.

2.- Samples description
    -------------------

    send_to_queue.java
	 Calls QueueSender to send a message to a queue

    consume_from_queue.java
	Calls QueueTopicReceiver to receive a message from a queue

    send_with_property.java 
	Calls QueueSender to send a message to a queue specifying
	a message property, that can be used later in the selector.

    consume_with_selector.java
	Calls QueueReceiver to receive a message from a queue
	using a selector.

    consume_with_selector_print_value.java
	Calls QueueReceiver to receive a message from a queue
	using a selector and prints the value retrieved from the message
	properties.

    queue_listener.java
	Calls QueueConsumer to consume messages from a queue.

    full_subscription_sample.java
        Ilustrates how to consume/publish messages using subscriptions.

    send_in_transaction_full.java
	Ilustrates transactional behaviour when messaging
	transactional mode is set to FULL

    send_in_transaction_simple.java
	Ilustrates transactional behaviour when messaging
	transactional mode is set to SIMPLE

    send_in_transaction_none
        Ilustrates transactional behaviour when messaging
	transactional mode is set to NONE

    print_global_variables
	Ilustrates the use of global variables

3.- Samples help
    ------------

	In all java samples, the '-help' parameter will display the usage.
	Also, if parameters provided are not the expected, the syntax will be
	displayed.

	For example:


	java send_to_queue -help

	Usage: java send_to_queue <options>


        Options:

                -host   Hostname/Hostaddress where ASE is running

                -port   Port Number where ASE is running

                -dbname Database name

4.- Samples workflow
    ----------------

	Example - 1

	    java send_to_queue -host cibeles -port 41000 -dbname rtm
	    java consume_from_queue -host cibeles -port 41000 -dbname rtm

	Example - 2

	    java send_with_property -host cibeles -port 41000 -dbname rtm
	    java consume_with_selector -host cibeles -port 41000 -dbname rtm

	Example - 3

	    java send_with_property -host cibeles -port 41000 -dbname rtm
	    java consume_with_selector_print_value -host cibeles -port 41000 -dbname rtm

	Example - 4
	
	From one session start a listener:

		java queue_listener -host cibeles -port 41000 -dbname rtm

	From a different session send messages:

		java send_to_queue -host cibeles -port 41000 -dbname rtm


	Example - 5

	    java full_subscription_sample  -host cibeles -port 41000 -dbname rtm -host neptuno -port 41000 -dbname rtm2

	Example - 6

	    java print_global_variables -host cibeles -port 41000 -dbname rtm


	Example - 7

	    java send_in_transaction_full -host cibeles -port 41000 -dbname rtm

	    java send_in_transaction_simple -host cibeles -port 41000 -dbname rtm
	    java send_in_transaction_none -host cibeles -port 41000 -dbname rtm


	Example - 8

	    java print_global_variables.java -host cibeles -port 41000 -dbname rtm


5.- Execution example
    -----------------

% java send_to_queue -host silverton -port 41000 -dbname rte



                ==========================================
                Example to send a single message to a queue
                ==========================================




Message Id: ID:E4JMS-SERVER.C30100B1211:1




                Use: java consume_from_queue to retrieve the message





