ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » PCF command to get last put time - Not working!

Post new topic  Reply to topic
 PCF command to get last put time - Not working! « View previous topic :: View next topic » 
Author Message
Pushkalaa Santhanam
PostPosted: Mon Apr 01, 2013 1:56 pm    Post subject: PCF command to get last put time - Not working! Reply with quote

Newbie

Joined: 12 Aug 2009
Posts: 2

Hi,

I am trying to get the last put datetime of a queue, i am using the below code snippet and it isn't working Help!

I am not sure whats worng..

Given below the snippet

PCFMessage request = null ;
request = new PCFMessage (CMQCFC.MQCMD_INQUIRE_Q_STATUS);
request.addParameter (com.ibm.mq.constants.CMQC.MQCA_Q_NAME, "A5");
request.addParameter (CMQCFC.MQIACF_Q_STATUS_ATTRS, CMQCFC.MQIACF_ALL);


PCFMessage [] responses = agent.send (request);

for (int i = 0; i < responses.length; i++)
{
String name = responses [i].getStringParameterValue (com.ibm.mq.constants.CMQC.MQCA_Q_NAME);
String pdate = (responses [i].getStringParameterValue(CMQCFC.MQCACF_LAST_PUT_DATE));
int[] qtime =(responses [i].getIntListParameterValue(CMQCFC.MQIACF_Q_TIME_INDICATOR));
System.out.println (name + "time:"+qtime+"date:" +pdate+"PRINTED");
}

The result is

Trying to connect!
Successfully connected!
Accessing Queue A5!
A5 time:[I@4f444f44date: PRINTED
Ending Queue A5!
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Apr 02, 2013 4:41 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Your program is working perfectly, it is producing exactly the result you have asked it to produce.

You should consider altering it so that it produces the result you *want*, instead.

I suspect you'll find that the result you want requires you to understand how to use Java data types properly.
Back to top
View user's profile Send private message
Pushkalaa Santhanam
PostPosted: Tue Apr 02, 2013 8:25 am    Post subject: Reply with quote

Newbie

Joined: 12 Aug 2009
Posts: 2

I actually want the timestamp of the lastputmessage, in the timestamp(yyyy-mm-dd hh:mm:ss) format.

I am not sure what i am missing , i tried multiple data-types for which all i received only error and only when i use String, i got some display without errors, can you please point out what i am exactly missing out..

It would be really helpful.

I am unable to figure out what i am missing..

Also i tried to convert the array to string with .toString and printed and all i got is [-1,-1].
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Apr 02, 2013 11:45 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

so who cares about what you want. You first have to evaluate what you receive. Then you can store / print it in the format you want...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » PCF command to get last put time - Not working!
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.