{
// Step 1. Obtain an Initial Context
initialContext = new InitialContext();
// Step 2. Lookup the EJB
SendMessageService service = (SendMessageService)initialContext.lookup("ejb-jms-transaction-example/SendMessageBean/remote");
// Step 3. Create the DB table which will be updated
service.createTable();
// Step 4. Invoke the sendAndUpdate method
service.sendAndUpdate("This is a text message");
System.out.println("invoked the EJB service");
// Step 5. Lookup the JMS connection factory
ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");