Forum Discussion

Arunsrs's avatar
Arunsrs
Occasional Contributor
6 years ago

Azure DB connection through Groovy

How to connect azure db through groovy scripting

14 Replies

  • Arunsrs's avatar
    Arunsrs
    Occasional Contributor

    Its pretty urgent , can some help me on this .

    I am using soap ui and i want to connect cosmos db

  • richie's avatar
    richie
    Community Hero

    Hi,

     

    was there an answer to this?  I can see it's been marked as complete - but I can't see a response providing an answer?!?!

     

    Would be good to get an answer on this post considering it's been marked as 'solved' to assist other people searching for the same thing! :)

     

    Cheers,

     

    richie

    • Arunsrs's avatar
      Arunsrs
      Occasional Contributor

      No Richie, its not resolved yet .We still having issue 

  • richie's avatar
    richie
    Community Hero

    Arunsrs

     

    gotcha - ok - erm - as the author of the ticket - is there any way you can remove the 'solved' flag?

     

    Currently people won't be looking at this post to try and answer it considering it's marked as 'solved'

     

    Cheers,

     

    richie

    • Arunsrs's avatar
      Arunsrs
      Occasional Contributor

      I am not sure , how to mark it unresolved , if requires will create new post.Anyway i just edit teh subject.But its really urgent 

  • richie's avatar
    richie
    Community Hero

    Hi,

     

    ok - I can't help you with the groovy - but you don't necessarily need to use groovy to do it anyway.

     

    if its cloud SQLServer or Windows Azure SQL - you can't use JDBC to connect to the database if its cloud (depending on the SaaS contract I believe)

     

    I've had a quick read and you can use JDBC - see the following: https://www.cdata.com/kb/tech/cosmosdb-jdbc-dbv.rst 

     

    You will need to download the correct .jar file drivers for the connection (you need to determine what version of cosmos your are trying to connect to) - try here https://www.cdata.com/drivers/cosmosdb/jdbc/ to pick up the driver files you need.  You need to add in the driver files to ReadyAPI!/bin/ext directory in your program files directory (e.g. C:\Program Files\SmartBear\ReadyAPI-2.5.0\bin\ext)

     

    You will then need to edit the JDBC preferences adding the appropriate jdbc connection - see the photo

     

     

    In the Driver field - input the following:  CosmosDBDriver/cdata.jdbc.cosmosdb.CosmosDBDriver

     

    In the Connection field input you need to add the following:  

    jdbc:cosmosdb:Server=anhohmongo.documents.azure.com;Port=10255;Database=test;User=contoso123:0Fc3IolnL123;Password=test;

     

    One other thing - you will need to ensure the version of Java you are using for your runtime is correct relative to the .jar files you are using a device drivers for the connection.  I'm assuming you already have JRE or JDK installed.  there is a reason (that I cant remember) that may impact you - even though you just need runtime files - grab  the JDK anyway - it has an extended set - there is a reason why you should grab the JDK rather than the JRE - I just cant remember what it is.

     

    See if that helps and hit me back,

     

    nice one,

     

    richie

    • Arunsrs's avatar
      Arunsrs
      Occasional Contributor

      Hello Richie,

       

      Azure db is non sql and DB is document type .On top i am not able to find any drived related to that .Could you please help me in this 

      • richie's avatar
        richie
        Community Hero

         

        ok - first things first - ignore ReadyAPI! for now

         

        have you got a db connection via a db interrogation tool already? i.e. have you got a connection to the db via dBvisualiser or any other DB interrogation tool?

         

        If you can use one of those tools to hit the DB - you should be able to setup the connection in ReadyAPI! - cos ReadyAPI's connection is doing the same thing as those db interrogation tools

         

        It shouldn't matter whether it's a NOSQL DB or not - COSMOS is a noSQL DB - but it still uses JDBC so you should be ok

         

        cheers,

         

        richie