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 » WebSphere Message Broker (ACE) Support » encoding in javaCompute

Post new topic  Reply to topic
 encoding in javaCompute « View previous topic :: View next topic » 
Author Message
SOLOHERO
PostPosted: Tue Sep 01, 2009 10:10 pm    Post subject: encoding in javaCompute Reply with quote

Centurion

Joined: 01 Feb 2007
Posts: 107

Sorry this might be a double post......


i got another problem here....in setting the encoding and ccsid in MQMD.

As u guys know they are type int.

how can i set a value to those fields..
if i am using the below statement it wont allow cause set value will take only string and i can see the value getting changed in the mqmd--encoding but when validating it throws cast exception.

note encoding is user defined value....


MbElement encod = outMessage.getRootElement().getFirstElementByPath("Properties/Encoding");
encod.setValue(encoding);



i tried using setSpecificType()..after parsing encoding to int but i cant see anyvalue .being set to encoding fied ...could some one guide me how and where am i going wrong..

MbElement encod = outMessage.getRootElement().getFirstElementByPath("Properties/Encoding");
encod.setSpecificType(encoding);
_________________
Thanks
Back to top
View user's profile Send private message Send e-mail
WMBDEV1
PostPosted: Wed Sep 02, 2009 12:47 am    Post subject: Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

The setValue method takes an object as its parameter.

What happens if you make an Integer object out of the int primitive and pass this to the setValue method?
Back to top
View user's profile Send private message
gs
PostPosted: Wed Sep 02, 2009 12:48 am    Post subject: Reply with quote

Master

Joined: 31 May 2007
Posts: 254
Location: Sweden

setValue actually takes an object as argument.

Code:
MbElement ccsid = outMessage.getRootElement().getFirstElementByPath("MQMD/CodedCharSetId");

Integer charset = 1208;
ccsid.setValue(charset);


If you want to modify the MQMD, use that element instead of Properties as in your code.
Back to top
View user's profile Send private message
WMBDEV1
PostPosted: Wed Sep 02, 2009 12:51 am    Post subject: Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

gs wrote:

Integer charset = 1208;


Should this not be:
Integer charset = new Integer(1208);
?

And a quick sanity check from the OP, why are you doing all this in Java? If you're doing simple transformations then ESQL will probably be easier and more efficient.
Back to top
View user's profile Send private message
gs
PostPosted: Wed Sep 02, 2009 1:03 am    Post subject: Reply with quote

Master

Joined: 31 May 2007
Posts: 254
Location: Sweden

WMBDEV1 wrote:
gs wrote:

Integer charset = 1208;


Should this not be:
Integer charset = new Integer(1208);
?


Yes, I was lazy and used autoboxing Using the constructor is definitely better from a strict perspective.
Back to top
View user's profile Send private message
SOLOHERO
PostPosted: Wed Sep 02, 2009 4:29 pm    Post subject: Reply with quote

Centurion

Joined: 01 Feb 2007
Posts: 107

Thanks guys....i dont know why i was thinking it is string................
_________________
Thanks
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 » WebSphere Message Broker (ACE) Support » encoding in javaCompute
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.