Hi Prathyush,
As you said, the datasource name you setup in server.xml is "set there", and in that way is "static". I gather from your message that you'd like to pick a different datasource, based on some condition; is this correct, or are you trying to do something else? Maybe it would help us understand what you're trying to do if you could share with us a little bit of background on your situation.
Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet