带有jdbc驱动程序的Cassandra CQL

时间:2014-02-20 15:38:10

标签: jdbc cassandra cql

我使用cassandra-jdbc-1.2.5 jar在cassandra中创建了一个简单的表

create table test(id text primaty key, starttime timestamp);

现在,当我使用以下代码选择查询:: select * from test时:

stmt = con.createStatement();
rs = stmt.executeQuery("select * from test");

我收到以下错误:

java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at the stmt.executeQuery line

但是,如果我使用:: select id from test,我会得到正确的答案并且我的查询运行完美。

问题是使用cassandra jdbc检索时间戳列。

0 个答案:

没有答案