/***************************************************************************/ /* */ /* (c) Copyright IBM Corp. 2000 All rights reserved. */ /* */ /* This sample program is owned by International Business Machines */ /* Corporation or one of its subsidiaries ("IBM") and is copyrighted */ /* and licensed, not sold. */ /* */ /* You may copy, modify, and distribute this sample program in any */ /* form without payment to IBM, for any purpose including developing, */ /* using, marketing or distributing programs that include or are */ /* derivative works of the sample program. */ /* */ /* The sample program is provided to you on an "AS IS" basis, without */ /* warranty of any kind. IBM HEREBY EXPRESSLY DISCLAIMS ALL WARRANTIES, */ /* EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED */ /* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Some jurisdictions do not allow for the exclusion or limitation of */ /* implied warranties, so the above limitations or exclusions may not */ /* apply to you. IBM shall not be liable for any damages you suffer as */ /* a result of using, modifying or distributing the sample program or */ /* its derivatives. */ /* */ /***************************************************************************/ /* */ /* Program name: mqjmsro */ /* */ /* Description: Sample java program that uses the jms interface to set the */ /* reporting options on the MQSeries MQMD. */ /* */ /***************************************************************************/ /* */ /* Function: */ /* */ /* This program is a java program that shows the setting of MQMD report */ /* options via jms. Even though it uses the jms interface, this code is */ /* written based on MQSeries (ie, it does not use a JNDI naming service). */ /* */ /* The program can be run as follows */ /* */ /* java mqjmsro -m */ /* */ /* The program will write a message to SYSTEM.DEFAULT.LOCAL.QUEUE. */ /* */ /* This program has been tested with MQSeries V5.1 CSD5 and JDK 1.1.7. */ /* */ /***************************************************************************/ /* */ /* mqjmsro has 1 parameter: */ /* queue manager name (optional) */ /* */ /***************************************************************************/ import javax.jms.*; /* import of Sun's JMS interface */ /* Imports for MQSeries specific objects */ import com.ibm.mq.MQC; import com.ibm.mq.jms.MQQueue; import com.ibm.mq.jms.MQQueueConnectionFactory; /* import to allow program */ /* to bypass JNDI lookup */ public class mqjmsro { public static String QMGR = ""; public static final String QUEUE = "SYSTEM.DEFAULT.LOCAL.QUEUE" ; public static void main( String[] args ) { String outString = "Test message from mqjmsro"; Queue ioQueue = null; QueueSession session = null; QueueConnection connection = null; QueueConnectionFactory factory = null; System.out.println("mqjmsro sample program"); /********************************************************/ /* Process command-line arguments looking for qmgr name */ /********************************************************/ for ( int i=0; i