Author |
Message
|
pmane |
Posted: Wed Nov 07, 2001 1:47 am Post subject: |
|
|
Acolyte
Joined: 17 Oct 2001 Posts: 50
|
I am reading a message from a Queue. The message was put by other client( Q Manager ) on running on mainframe . It genarted message id on it own. Now I want to record this message in my database. I want to also put the message id as the primary key in my DB which will store information related to the processing of that message. I must be in position to send him this information in my db if he gives me the messageid .
My problem is MEssageID is MQByte24. If I try to display this it shows garbage data. I am using Java . Dose any one has any clue ?
If I want to store the message in a database
for some reason can message id act as key ? |
|
Back to top |
|
 |
bower5932 |
Posted: Wed Nov 07, 2001 11:00 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
You can attempt to use the message id as a key in your database. Since the field is a byte field and not character data, you can expect to have trouble printing it out. The field may contain unprintable characters. You'll also need to store it in a column that accepts binary data. The field can have embedded 00's which will terminate a string. Hope this helps.
[ This Message was edited by: bower5932 on 2001-11-07 11:01 ] |
|
Back to top |
|
 |
middlewareonline |
Posted: Wed Nov 07, 2001 12:17 pm Post subject: |
|
|
Acolyte
Joined: 09 Jul 2001 Posts: 73
|
Use a BLOB type to store your key. You may have problem creating it as PK.
MiddlewareOnline.com |
|
Back to top |
|
 |
pmane |
Posted: Wed Nov 07, 2001 5:16 pm Post subject: |
|
|
Acolyte
Joined: 17 Oct 2001 Posts: 50
|
1.Thanks for your infomration. It was very helpful. I tried to store Msgid in database using blob but thing is I can not do a search on blob as = is not supported in select (Please correct me if I am wrong). Any one has any idea about how the MQ msgid can be stored in db and got back again safly as MQByte in Java ? Or am I making a mistake to store MQMD fileds in database ?
Thanks,
Prashant
[ This Message was edited by: pmane on 2001-11-08 00:30 ] |
|
Back to top |
|
 |
EddieA |
Posted: Thu Nov 08, 2001 6:22 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
You could always write a couple of small routines to expand the hex nibbles into characters and then back again. It would make the field 48 characters long instead of 24.
eg. x'12ab78de' to C'12AB78DE' (x'3132414237384445').
Cheers,
_________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
pmane |
Posted: Thu Nov 08, 2001 5:35 pm Post subject: |
|
|
Acolyte
Joined: 17 Oct 2001 Posts: 50
|
Thanks , I will do that but I fear that It will create some over head for my processing. I was trying to get some direct way-out since IBM mentions that we can store these MQMD headers and then use them as we need in one of its manuals. I feel that IBM should have given some conversion runtines or lookup tables like in i18.jar package. Or else I am making mistake to store it in them DB. This kind of conversion might look easy in JAVA but it will be very difficult in COBOL (I am not lucky enough to get all the code written in JAVA ).
Thanks again for all your help !
|
|
Back to top |
|
 |
EddieA |
Posted: Fri Nov 09, 2001 6:52 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
If you want to do it in COBOL, then it would be trivial to write a very small assembler routine to do it. I'm assuming mainframe here. Don't know what's avaialable on other platforms.
In fact, one of the OS/390 Support Pacs includes the routine to convert hex to 'expanded' character.
Cheers,
_________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
|