I am new to cassandra and I want to connect to cassandra with java jdbc.I use the code below and get this error message...
try {
Class.forName(driver).newInstance();
con = DriverManager.getConnection(url, username, password);
System.out.println(con);
} catch(Exception e){
e.printStackTrace();
}
ERROR: Exception in thread "main" java.lang.NoSuchMethodError: org.apache.cassandra.thrift.Cassandra$Client.set_cql_version(Ljava/lang/String;)V at org.apache.cassandra.cql.jdbc.CassandraConnection.(CassandraConnection.java:138) at org.apache.cassandra.cql.jdbc.CassandraDriver.connect(CassandraDriver.java:92) at java.sql.DriverManager.getConnection(DriverManager.java:620) at java.sql.DriverManager.getConnection(DriverManager.java:200) at connect.Connect.main(Connect.java:24)
also I use these jars:
- hector-core-1.1-2
- libthrift-0.6.1.jar
- cassandra-jdbc-1.2.1.jar
- cassandra-all-0.7.0.jar
Can anyone help me please?