Creating a Connection object to start a session.

Enterprise Java
Guarantee Inter-Enterprise Message Delivery Using JMS
Gopalan Suresh Raj
Listing 2. Creating a Connection object to start a session.


//  Create and start a topic connection
javax.jms.TopicConnection connection =
                     factory.createTopicConnection(user, password);
connection.start ();
//  Create a topic session on this connection
javax.jms.TopicSession session = connection.createTopicSession
                             (false, Session.AUTO_ACKNOWLEDGE);