Forum Discussion

ReshmaSachdev's avatar
ReshmaSachdev
Contributor
12 years ago

How to change data connection at run time

Hello,
I am having multiple envirnoments and accordingly there are multiple data base connection.
My question is how can i assocaite envirnoment to data base connection? [As while using data source - JDBC/ JDBC test step, one has to manually select the data base connection from drop down].
My scripts are running on nightly basis on different envirnoments, but i have to manually pull the connection before it starts.
Can any one help me in this regard?

3 Replies

  • PaulDonny's avatar
    PaulDonny
    Regular Contributor
    This would require a groovy script. My personal suggestion would be to store all of the endpoints to individual properties and then have a single endpoint property that is always used and store the correlating endpoint to that property using a groovy script that will determine which one is required.

    Sadly, without more information, I can not really develop an example for you.
  • Thanks Paul for the suggestion...

    But for envirnoment[end point] i have already used as property at project level, but JDBC connection how can i store in property and they play with groovy as suggested by you..
    I am attaching the sample JDBC connection that we have.. and based on envirnoment need to pull appropriately.