Forum Discussion

zsousa's avatar
zsousa
Contributor
9 years ago

Environments

is there a way to link environments with certain databases? so I have several environments and several databases. What I want to do is when I switch to a new environment I want the system to also select the correct database that goes along with that environments.

 

any ideas how to accomplish this ?

  • zsousa's avatar
    zsousa
    9 years ago

    so the issue turned out to be the way I created my db connections. instead of me just creating a DB template string and then changing that string for each environment, I created a db connection string for each environment for each database connection.

     

    I wish SOAPUI had better documentation for new people like me , so that we don't get into this mess.

     

     

    I want to thank you all for helping me out.

  • 1. Create a new database connection under 'Databases' for your project.

    2. Name is something which makes sense for your application like 'APP1_DB'

    3. Now go to 'Environments' module and do below for each environment

            a. Go to JDBC Connections tab in environment

            b. The new DB you created under Databases should show up there

            c. Change the DB Driver/ Connection string value to what's specific to the environment.

    4. Use the saved DB Name in JDBC Tests Steps, JDBC Data Sources etc. 

    5. When you switch environment for execution, Ready API should should use the appropriate DB Conneciton settings as you specified in step 3 for each environment.

     

    Regards,

    Gilu Gopi

     

    • zsousa's avatar
      zsousa
      Contributor

       

      This doesn’t work. So when I go to the “JDBC Connection” tab under environments I see several connections how do I set up which DB connection to each environment.

       

      • gilugopi's avatar
        gilugopi
        Contributor

        If you see several connections under JDBC Connection tab in environments, that probably means you've already created multiple JDBC Conenctions under 'Databases' module.

         

        Let's say you have just one database for each environment. In this case

        1. Under 'Databases' module you should create only one.. ( if you have more than one there, just delete the rest to avoid any confusion.

        2. This one connection you created will show up under each of the enviornments. In each environment you would see Driver and Connection string column as editable. For each envionment change the connection string and driver to point to the specific database. 

         

        I just tried and it works for me. If this don't work for you and have a valid license, try contacting smartbear support. They might point you to some tutorial and guide you.