Just getting into Cassandra. Set up version 2.0.1 and server is running fine and cqlsh connects and properly executes various commands so I know the infrastructure is OK.
I have a small Java test program. I am using a recent Java 7 JDK on OS X 10.8.3 (Darwin):
java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)
because Cassandra 2.0.1 needs Java 7. I started with these libs as noted in the jdbc wiki page:
cassandra-jdbc-1.2.5.jar
apache-cassandra-thrift-2.0.1.jar
apache-cassandra-clientutil-2.0.1.jar
and upon calling this code
String driverClass = "org.apache.cassandra.cql.jdbc.CassandraDriver";
Class.forName( driverClass ).newInstance();
// mykeyspace was created in the setup example
java.sql.Connection conn = DriverManager.getConnection("jdbc:cassandra://localhost:9160/mykeyspace");
getConnection() throws a java.lang.NoClassDefFoundError for org/apache/thrift/TEnum. No problem -- I found that in libthrift-0.9.1.jar and added that to the class path. Then I get java.lang.NoClassDefFoundError for org.apache.cassandra.cql.jdbc.AbstractJdbcType. I grep the cassandra-jdbc-1.2.5.jar for AbstractJdbcType but it is not found. I grep for Abstract and I see
org/apache/cassandra/cql/jdbc/AbstractConnection.class
org/apache/cassandra/cql/jdbc/AbstractResultSet.class
org/apache/cassandra/cql/jdbc/AbstractStatement.class
I downloaded the older versions of the JDBC lib (1.1.2 and 1.2.1) but they don't see to contain org.apache.cassandra.cql.jdbc.AbstractJdbcType either.
Googling for org.apache.cassandra.cql.jdbc.AbstractJdbcType reveals it was in the cassandra-all/1.0.0 build? Maybe?
I downloaded the 1.2.5 source and rebuilt it and it fails to compile because getSchema() is not overridden in ManagedConnection.java:
class ManagedConnection extends AbstractConnection implements Connection
...
getSchema() is new in Java 7 java.sql.Connection.
I think I am mixing the wrong versions of jars, JDKs, or possibly 2.0.1 and the jdbc 1.2.5 are not compatible...? Can anyone name the proper set of jars to use JDBC and v2.0.1?