SoapUI JDBC connection with Apache Cassandra

前端 未结 4 780
长发绾君心
长发绾君心 2021-01-16 03:43

Does anyone know how to connect to cassandra using JDBC connection string in SoapUI.

I have tried from my side, but not able to connect. Based on the research I came

4条回答
  •  悲哀的现实
    2021-01-16 03:51

    I was able to do it with a creation of Cassandra cluster and using it to connect to the cassandra as following:

    import com.datastax.driver.core.Cluster;
    import com.datastax.driver.core.Session;
    
    def rs;
    
    //query
    def qry = "select id soapuikeyspace.users where id='aaa';"
    
    //create cluster for cassandra
    Cluster cluster = new Cluster.Builder().addContactPoint("localhost").withCredentials("cassandra", "cassandra").withPort(9042).build();
    
    //get seesionm from cassandra claster
    session = cluster.connect();
    
    //get result set
    rs = session.execute(qry);
    

    Required jar's:

    • cassandra-all-2.0.6.jar
    • cassandra-driver-core-2.0.1.jar
    • netty-3.9.0.Final.jar
    • metrics-core-3.0.2.jar

提交回复
热议问题