|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Efficient use of name value pairs in WBI |
« View previous topic :: View next topic » |
Author |
Message
|
dilse |
Posted: Fri Sep 23, 2005 8:41 am Post subject: Efficient use of name value pairs in WBI |
|
|
 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 |
|
 |
jefflowrey |
Posted: Fri Sep 23, 2005 8:44 am Post subject: |
|
|
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 |
|
 |
PGoodhart |
Posted: Fri Sep 23, 2005 9:36 am Post subject: |
|
|
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 |
|
 |
dilse |
Posted: Fri Sep 23, 2005 10:20 am Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|