Topic: 谁能提供mq传输文件的方法

  Print this page

1.谁能提供mq传输文件的方法 Copy to clipboard
Posted by: fastray
Posted on: 2003-08-26 08:42

用流的方法向mq传输文件,但屡次不成功,那位朋友有成功的经验,介绍一下(最好有源码)

2.Re:谁能提供mq传输文件的方法 [Re: fastray] Copy to clipboard
Posted by: wishmaster
Posted on: 2003-09-09 17:22

go to IBM support site and download support pak...

3.Re:谁能提供mq传输文件的方法 [Re: fastray] Copy to clipboard
Posted by: microwin
Posted on: 2003-10-27 15:03

/**
* <p>Title: MQ实例测试程序!</p>
* @author Microwin
* @version 1.0
*/
import com.ibm.mq.*;

public class ConnMQ4 {

private String qManager_name = "QM_P2P_XXXXX";
private String qQueue_name = "Q1";
private MQQueueManager mqQueueManager;
private MQQueue mqQueue;

public ConnMQ4() {
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES);
MQEnvironment.CCSID=1381;
}

public void conn(){
try {
   mqQueueManager =new MQQueueManager(qManager_name);
   System.out.println("成功连接QueueManager");
   //----------------------------------------
   int openOptions = MQC.MQOO_INPUT_AS_Q_DEF|MQC.MQOO_OUTPUT;
   mqQueue = mqQueueManager.accessQueue(qQueue_name,openOptions);
   MQPutMessageOptions mpmo = new MQPutMessageOptions();
   MQMessage mqMessage = new MQMessage();
   mqMessage.writeInt(25);
   mqMessage.writeString("good");
   mqQueue.put(mqMessage,mpmo);
}
catch (MQException ex) {
   System.out.println("Error Code : " + ex.reasonCode);
   ex.printStackTrace();
}
catch(java.io.IOException ex){
   ex.printStackTrace();
}
finally {
   try {
   if(mqQueue!=null){
     mqQueue.close();
     System.out.println("成功关闭Queue");
    }
    if(mqQueueManager!=null){
     mqQueueManager.close();
     mqQueueManager.disconnect();
     System.out.println("成功关闭、断开QueueManager");
    }
   }
   catch (MQException ex) {

   }//end try-catch

}//end try-catch

}

public static void main(String[] args) {
ConnMQ4 connMQ41 = new ConnMQ4();
connMQ41.conn();
}
}


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923