Forum Discussion

vikititor's avatar
vikititor
Contributor
5 years ago

Is any way, how to switch all JDBC steps from MySQL to ORACLE ? on whole project at once?

Hello, 

I was unable to found out a way, how to change on all my JDBC test steps the connection - I must go to one by one and change connection form drop box.. 

But my project is huge.. Now we have to migrate from MySQL to ORACLE. The querys are equal (only select from table, but a lot of them). 

 

It there any way, how to save my energy and do the switch form ReadyAPI UI? 

Because I have in my mind only way.. just edit project XML file and replace it there.. But this is dirty solution.. And I can make mistake and broke my whole project.

 

Any suggestion is wellcomed.. can be some Groovy script.. I have no idea.. 

Thanks a lot.

  • vikititor's avatar
    vikititor
    5 years ago

    Sorry I did not get your point.. This is a question?

    I can not change the driver in all the JDBC steps.. I must open step by step and chagne the driver in there..

    And this is my problem... 

    Missing "assign to all test steps" button or something.. Who will do this job for me.. 

     

    Work arround: Next time create all as a project propertie.. and there you can configure and re-configure all during run-time.. Nice.. but more than 50 project properties (what I have) is really messy.. 

  • richie's avatar
    richie
    Community Hero
    Hey vikititor,

    I had a similar issue last year but i had to go from a local sqlserver to a remote and i found a way to use the gui to get it done.
    However, my approach wont work in your example cos youre switching RDBMSs to which requires a driver switch (which isnt parameterisable in the gui unlike the other connection properties).

    As you say, you can edit the project .xml file, but its a dodgy option, althougj entirely feasible...youd just need to make sure your find/replace was perfect.

    Anyway, i found a stackoverflow post that provides a groovy option to switch all jdbc teststeps connection properties. This is just ome of the options though...im sure theres a number of them.

    https://stackoverflow.com/questions/38368755/how-to-apply-connection-settings-to-all-jdbc-test-steps-in-soapui

    Hope it helps,

    Rich
    • vikititor's avatar
      vikititor
      Contributor

      Hello, 

      unfortunetally this script not works at all for me.. I can found only the test cases in my test suite.. After whole a day.. investigationg, how to select "JUST" JDBC test step.. I must do that manually.. 

       

      Because there is no way, how to manage it form central point. 

       

      ??? Why database manager is there? When we can not assign connection form it to all test steps?

      ??? Why the model is so over complicated, that selection of test step base don the dype not works?

       

      Better to replace this in project XML file.. really.. 

       

      • ChrisAdams's avatar
        ChrisAdams
        Champion Level 3

        Hi,

         

        Bit late to this one, but here goes....

         

        Assuming you have used the db connections in the Environments part of the UI, you could have a bunch a db connections.  E.g. customer-db, sales-db etc.  Each of these have the name you see in the JDBC step dropdown, driver to use and connection details.  In theEnvironments part of the UI, can you not simply change the driver and update the connection details?  The should result in any connection in JDBC step or Groovy script that connects via connection name to use the updated details.