In this example, a sample fragment shows how to extract conname
.
PCFMessage pcfCmd = new PCFMessage(MQConstants.MQCMD_INQUIRE_Q_STATUS);
pcfCmd.addParameter(MQConstants.MQCA_Q_NAME, "MYQ");
pcfCmd.addParameter(MQConstants.MQIACF_Q_STATUS_TYPE, MQConstants.MQIACF_Q_HANDLE);
pcfCmd.addParameter(MQConstants.MQIACF_Q_STATUS_ATTRS, MQConstants.MQCACH_CONNECTION_NAME);
PCFMessage[] pcfResponse = pcfCM.agent.send(pcfCmd);
try{
for(int i = 0; i < pcfResponse.length;i++){
String name = (String) pcfResponse[i].getParameterValue(MQConstants.MQCACH_CONNECTION_NAME);
System.out.println("Connection Name: " + name);
}
}catch(Exception ex) {
System.out.print(ex);
}
You can change the fragment to suit your needs. Hope this helps.
source
share