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 » Efficient use of name value pairs in WBI

Post new topic  Reply to topic
 Efficient use of name value pairs in WBI « View previous topic :: View next topic » 
Author Message
dilse
PostPosted: Fri Sep 23, 2005 8:41 am    Post subject: Efficient use of name value pairs in WBI Reply with quote

Master

Joined: 24 Jun 2004
Posts: 270

Hi Guys,

We are on WBIMB V5 CSD05. We have a requirement that we are going to have some name value pairs that we need to use in our applications. We avoided the option of using database table because connecting to database may degrade the performance of application. We have like 50-80 name value pairs. Now what are the options I have infront of me other than coding IF ELSE statement for each name value pair. Please advise me on this. Every suggestion will result in efficient designing of this application.


Thanks,
_________________
DilSe..

Take life as it comes..
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Sep 23, 2005 8:44 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You could write a Java stored procedure that would access a singleton that held the name/value pairs. Basically something that wrapped a hash table that was loaded from a properties file.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
PGoodhart
PostPosted: Fri Sep 23, 2005 9:36 am    Post subject: Reply with quote

Master

Joined: 17 Jun 2004
Posts: 278
Location: Harrisburg PA

Here is how to do it in pure ESQL


/* Put the pair definition in your Main Function */
SET Environment.Variables.Pairs[] =
LIST{ROW('Variable1' AS ValueName, '1234' AS TheValue),
ROW('Variable2' AS ValueName, '5231' AS TheValue),
ROW('Variable3' AS ValueName, '2342' AS TheValue),
ROW('Variable4' AS ValueName, '1234' AS TheValue)
};

/* Here is the Function to get the value back */

CREATE FUNCTION GetTheValue(InputValueName CHARACTER) RETURNS CHARACTER
BEGIN

DECLARE OutputValue CHARACTER '';


SET OutputValue = COALESCE(TRIM(THE(SELECT ITEM Env.TheValue[1] FROM Environment.Variables.Pairs[] AS Env WHERE Env.ValueName = InputValueName)),
'');

RETURN OutputValue;
END;
_________________
Patrick Goodhart
MQ Admin/Web Developer/Consultant
WebSphere Application Server Admin
Back to top
View user's profile Send private message
dilse
PostPosted: Fri Sep 23, 2005 10:20 am    Post subject: Reply with quote

Master

Joined: 24 Jun 2004
Posts: 270

Thanks a lot for your Valuable suggestions Jeff and PGoodHart. I will try both ways. I really appreciate your quick replies.

Jeff,
If possible, could you give some information as to where can I find some manuals or papers on "how to work with property files".

Thanks,
_________________
DilSe..

Take life as it comes..
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Efficient use of name value pairs in WBI
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.