Forum Discussion

sguru's avatar
sguru
Occasional Contributor
6 years ago

Soap UI Pro - Using Couchbase as DataSource - Could somebody help with it?

I am attempting to use Couchbase DB as datasource. CB bucked has to be authenticated with username/password to query. I have searched all the available forums, I do not find any reliable ones for accomplishing this.

 

Can somebody help with this in details...

2 Replies

  • richie's avatar
    richie
    Community Hero

    Hi,

     

    I dont know couchbase myself - but I had a quick look around and I suspect it will be similar to other DB connections in SoapUI.

     

    You use JDBC to connect to a database in SoapUI  - so you need to determine the Couchbase JDBC connection string - something like the following:

     

    jdbc:couchbase://[Host]:[Port]/[Database];

     

     

    You'll need to investigate which version of Java Couchbase uses via JDBC and get the appropriate version of Java also.  Just a note - Couchbase seems new and so will probably use a recent version of Java - I need to highlight that if the version of Java is too old - this will impact negatively with any groovyscripting you have in your soapui project (for example I had to use .jar files that were developed for java 2 - this broke my groovyscripts).

     

    You'll also need to find the driver .jar files SoapUI will use to connect to the database. 

     

    I put together the following instructions for myself when connecting to a MIMER RDBMS - I'd follow these instructions and just swap out the couchbase relevant bits

     

    1.  Install relevant version of JDK - that your Couchbase DB .jar files use to create a JDBC connection
    
    2.  Ensure PATH environment variable doesn't point to another version of Java
    
    3.  Set JAVA_HOME to JDKvX.Xs bin directory (e.g. C:\jdkv1.8\bin) - e.g. at command prompt run 'set JAVA_HOME=%JAVA_HOME%;C:\jdkv1.8\bin'
    
    4.  At command prompt run 'java -version' to ensure it's picking up JDKv1.8 rather than other versions of Java
    
    5.  Download the couchbase jdbc driver file (???????.jar) and copy this to 'C:\Program Files\SmartBear\ReadyAPI-n.n.n\bin\ext'
    
    6.  Create or  update the CLASSPATH environment variable, pointing to the location of the .jar file.  Run the following command via command prompt 'set CLASSPATH=%CLASSPATH%;C:\Program Files\SmartBear\ReadyAPI-n.n.n\bin\ext'
    
    7.  Within SoapUI's JDBC preferences, add in an entry - 'Driver column' value = 'UniqueIdentifier/com.couchbase.jdbc.Driver'.  In the 'Connection String Template' column add in the value 'jdbc:couchbase://[Host]:[Port]/[Database];'  

    Hopefully something like the above will sort your connection.

     

    I should highlight that I struggled with the connection string for the MIMER db - I had to alter it slightly from the published info to get it to work - but that was the major problem I had

     

    have a look here for the info you need for drivers, connection strings etc.

     

    cheers,

     

    rich