Ask a Question

Groovy - Cassandra Connection using core datastax drivers not JDBC

pedro
Occasional Contributor

Groovy - Cassandra Connection using core datastax drivers not JDBC

I have tried to use JDBC connection string but I am having the following error message while trying to establish the connection to cassandra but as I have a native port cassandra set up

 

Can anyone help on USING core datastax drivers INSTEAD JDBC connection?

 

Code (JDBC not working with my cassandra setup):

 

import java.sql.DriverManager;
import java.sql.SQLFeatureNotSupportedException;
import java.sql.Statement;
import javax.sql.DataSource;
import org.apache.cassandra.cql.jdbc.*;

 

com.eviware.soapui.support.GroovyUtils.registerJdbcDriver("org.apache.cassandra.cql.jdbc.CassandraDriver");

 

def con = DriverManager.getConnection("jdbc:cassandra://IP_ADDRESS:9042/activation"); //keyspace has to be in lowercase

 

def stmt = con.createStatement();

//add data
def qry = "SELECT * fROM activation WHERE activation_id = '001010126' and activation_N_id ='01';"
def rs = stmt.executeUpdate(qry)

 

ERRROR MESSAGE

java.sql.SQLExeption: Incorrect URL: jdbc:cassandra...

(Image Attached)

 

 

 

3 REPLIES 3
sanj
Super Contributor

Re: Groovy - Cassandra Connection using core datastax drivers not JDBC

@pedro

Is your connection string correct.

Does not sound like an issue with JDBC

 

https://stackoverflow.com/questions/30743272/what-is-the-connection-url-to-be-used-for-cassandra

 

anu_r
New Contributor

Re: Groovy - Cassandra Connection using core datastax drivers not JDBC

@pedro Are u able to connect to Cassandra from SoapUI. I am using  Cassandra 3.0.12.1586 | DSE 5.0.7 |

nmrao
Community Hero

Re: Groovy - Cassandra Connection using core datastax drivers not JDBC

@anu_r, is the below question on stackoverflow yours? Happened to answer there, check it please.
https://stackoverflow.com/questions/46674990/connecting-to-cassandra-through-soapui/46676742#4667674...


Regards,
Rao.
cancel
Showing results for 
Search instead for 
Did you mean: