Author |
Message
|
yaravind |
Posted: Fri Oct 18, 2002 11:24 am Post subject: MANY ways of writing strings to a Queue-CONFUSED |
|
|
Apprentice
Joined: 17 Jun 2002 Posts: 25
|
I want to store a java String in the MQMessage class. For this I see that there are many ways to do
writeBytes(String s)
writeChars(String s)
writeString(String s)
writeUTF(String s)
I am confused which one to use. Can u pls let me know the differences among these four and which one do u recommend.
The string message i put on a queue is being processed by a mainframe CICS transaction
Thanks in advance  |
|
Back to top |
|
 |
boaz |
Posted: Sun Oct 20, 2002 3:56 am Post subject: Re |
|
|
Apprentice
Joined: 28 May 2002 Posts: 43
|
I think it is easier to use a JMS TextMessage so you simply use
the
Code: |
setText(java.lang.String string) |
|
|
Back to top |
|
 |
yaravind |
Posted: Sun Oct 20, 2002 6:04 am Post subject: |
|
|
Apprentice
Joined: 17 Jun 2002 Posts: 25
|
I am using only IBM Base java API |
|
Back to top |
|
 |
RogerLacroix |
Posted: Sun Oct 20, 2002 8:22 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Hi,
I find writeString() works just fine when sending messages to the mainframe. Just make sure you set MQMessage format to MQC.MQFMT_STRING.
later
Roger... _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
harwinderr |
Posted: Thu Nov 14, 2002 8:27 pm Post subject: |
|
|
 Voyager
Joined: 29 Jan 2002 Posts: 90
|
Actually the method writeString() writes a string , converting it to the codeset identified by the characterSet member variable.
The default value of the characterSet variable is MQC.MQCCSI_Q_MGR, which specifies that the character data in the application message data is in the queue manager's character set.
Additional character set values are supported like
850 - commonly used ASCII codeset
819 - the ISO ASCII
1208 - UTF.
But the writeUTF() method writes the string in the UTF format only. |
|
Back to top |
|
 |
|