Database JNDI name as parameter

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Database JNDI name as parameter

OpenESB Community Forum mailing list
Hi,

I have the following use case:-

I need to obtain some data from one of several databases, but I do now know
which database until I have run another query.




So, I perform a lookup to obtain the target database, then run my main query
against the target. The query to be run will be the same prepared statement
regardless of the target.

My question is therefore, can I dynamically set the JNDI name of the second
database, or do I need to have a conditional to determine which of a bank of
targets need to be invoked?

Thanks
Dave.



--
Sent from: http://openesb-community-forum.794670.n2.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: Database JNDI name as parameter

jinHo
Reply | Threaded
Open this post in threaded view
|

Re: Database JNDI name as parameter

OpenESB Community Forum mailing list
The problem is that it is not known until after running a query in the BPEL
- only after looking it up on a per-case basis can I know which DB to
access.

At the moment, it's a chain of IF... - but I'd prefer to be able to pass the
JNDI name in on the fly, if I could

-----Original Message-----
From: User <[hidden email]> On Behalf Of jinHo
Sent: 07 May 2019 10:33
To: [hidden email]
Subject: Re: [User] Database JNDI name as parameter

Donno if it helps but you could try to change it here
<http://openesb-community-forum.794670.n2.nabble.com/file/t395955/Annotation
_2019-05-07_173225.png>



--
Sent from: http://openesb-community-forum.794670.n2.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Database JNDI name as parameter

jinHo
You queried the JNDI name from database right?
After that query, u can convert it to string, normalize space it then copy
that JNDI into the DatabaseBC NM property.



--
Sent from: http://openesb-community-forum.794670.n2.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: Database JNDI name as parameter

OpenESB Community Forum mailing list
Not quite - but I can derive the JNDI name from the result of the first
query, so close enough.

The last time I tried setting the DB property (quite a while ago) it did not
give the expected results - I'll give it another go.

-----Original Message-----
From: User <[hidden email]> On Behalf Of jinHo
Sent: 08 May 2019 06:49
To: [hidden email]
Subject: Re: [User] Database JNDI name as parameter

You queried the JNDI name from database right?
After that query, u can convert it to string, normalize space it then copy
that JNDI into the DatabaseBC NM property.



--
Sent from: http://openesb-community-forum.794670.n2.nabble.com/