Forum Discussion
richie
Community Hero
Hey ameesh1984,
I'm guessing yes but im not 100% certain. I use ReadyAPI! but im guessing for db connections SoapUI and SoapUI Pro would be the same.
Theres 3 basic things you need to setup a db connection
1. driver file(s)
2. Java
3. Connection URL
1. Youll need to download the appropriate JDBC driver .jar files to connect to the database and save them in appropriate soapui program files directory. (If you google "cosmosDB version 'whatever' jdbc driver files" you should find some helpful links to pick up the .jar files). It might be called something like azure-documentdb-2.1.0.jar (someone picked up this .jar file to connect to cosmosDB in ReadyAPI!)
2. Youll need to download and install the correct version of Java (get the jdk not the jre download) that supports executing the driver .jar files youve already downloaded.
NOTE:If you can get both 64bit and 32bit (x86) versions of SoapUI, youll need to download the equivalent 'bit type' (dunno what else to call it) Java version. I.e. if you have 64bit SoapUI, you need to install 64bit Java , if 32bit (x86) SoapUI, youll need 32bit Java.
3. Youll need to identify the correct connection string URL which is required by ReadyAPI! and once you know the format, youll need to add this to the JDBC section of ReadyAPI!'s Preferences. Your connection string will probably look something like the following:
jdbc:cosmosdb:Server=anhohmongo.documents.azure.com;Port=10255;Database=test;User=contoso123:0Fc3IolnL123;Password=test;
(Obviously you would need to confirm your db instances connection parameter settings)
I sometimes find setting up a brand new db connection in ReadyAPI!/SoapUI a little fiddly, so what i do is setup a new db connection in a DB interrogation tool (like TOAD or DBVisualiser, etc.) Instead to test my settings and setup. You use exactly the same settings in a DB interrogatiom tool as you use in ReadyAPI!/SoapUI so once i know ive got a connection in DBVisualiser then i just replicate those settings in ReadyAPI!/SoapUI.
Cheers,
Rich
I'm guessing yes but im not 100% certain. I use ReadyAPI! but im guessing for db connections SoapUI and SoapUI Pro would be the same.
Theres 3 basic things you need to setup a db connection
1. driver file(s)
2. Java
3. Connection URL
1. Youll need to download the appropriate JDBC driver .jar files to connect to the database and save them in appropriate soapui program files directory. (If you google "cosmosDB version 'whatever' jdbc driver files" you should find some helpful links to pick up the .jar files). It might be called something like azure-documentdb-2.1.0.jar (someone picked up this .jar file to connect to cosmosDB in ReadyAPI!)
2. Youll need to download and install the correct version of Java (get the jdk not the jre download) that supports executing the driver .jar files youve already downloaded.
NOTE:If you can get both 64bit and 32bit (x86) versions of SoapUI, youll need to download the equivalent 'bit type' (dunno what else to call it) Java version. I.e. if you have 64bit SoapUI, you need to install 64bit Java , if 32bit (x86) SoapUI, youll need 32bit Java.
3. Youll need to identify the correct connection string URL which is required by ReadyAPI! and once you know the format, youll need to add this to the JDBC section of ReadyAPI!'s Preferences. Your connection string will probably look something like the following:
jdbc:cosmosdb:Server=anhohmongo.documents.azure.com;Port=10255;Database=test;User=contoso123:0Fc3IolnL123;Password=test;
(Obviously you would need to confirm your db instances connection parameter settings)
I sometimes find setting up a brand new db connection in ReadyAPI!/SoapUI a little fiddly, so what i do is setup a new db connection in a DB interrogation tool (like TOAD or DBVisualiser, etc.) Instead to test my settings and setup. You use exactly the same settings in a DB interrogatiom tool as you use in ReadyAPI!/SoapUI so once i know ive got a connection in DBVisualiser then i just replicate those settings in ReadyAPI!/SoapUI.
Cheers,
Rich
ameesh1984
5 years agoContributor
I see azure cosmos db has its own rest calls so we can use that directly from soap ui instead of using the jdbc driver
https://docs.microsoft.com/en-us/rest/api/cosmos-db/
https://docs.microsoft.com/en-us/rest/api/cosmos-db/
- richie5 years agoCommunity HeroHey ameesh1984,
Ah...sorry...my bad...i thought you wanted an SQL connection.
I just want to highlight that my experience of querying a db via REST (ive queried a cloud based Windows Azure SQL DB via its WebAPI) has been quite difficult on certain occasions to put the REST parms together if youre executing a complex query.
Actually, remembering back to when i was doing it about a year ago, it was actually impossible to execute certain complex SQL functions (e.g. CAST, etc.) via the REST API.....the API just didnt support that sort of thing. You can still join etc., but i dont think that i could do subqueries if memory serves.
Maybe cosmosDB is different....its a NoSQL database, right? Yeah, nope...ive got zero experience hitting a NoSQL db, so i'll shut up about it! 🙂
Cheers,
Rich- ameesh19845 years agoContributorIf you see this link on azure site they have a lot of get and post rest calls to cosmos azure db which shows its widely used for Nosql
https://docs.microsoft.com/en-us/rest/api/cosmos-db/
Any idea on those they seems simple queries to the db- richie5 years agoCommunity HeroHey ameesh1984,
i had a quick look at a GET (SELECT query) and it appears very simple....i.e. you can do a simple SELECT with basic filters and you can do INNER JOINS (didnt see any aggregate functions) but that appears to be the limit of what the REST API supports so looks a little disappointing.
HOWEVER, I need to highlight that i dont know how data is stored in a NoSQL database. Perhaps due to how the data is stored referentially etc. more complex queries arent necessary to do what you need?
I do appreciate that if youre hitting a cloud hosted database, typically the host doesnt allow its customers direct queryable access via JDBC like you would have for an on premise instance.
I always try and put my SQL together in a single complex query rather than multiple sequential queries (cos i like stretching my mind a bit and its more efficient), but theres nothing wrong in having multiple queries instead of a single complex query. Perhaps this is the approach you should use id you need to put a complex query together?
Sorry i cant be more help!
Rich
Related Content
- 3 years ago
Recent Discussions
- 15 years ago