incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Evans <eev...@acunu.com>
Subject Re: Cassandra jdbc-driver: no viable alternative at character '?'
Date Thu, 08 Dec 2011 15:29:23 GMT
On Thu, Dec 8, 2011 at 4:20 AM, Dinusha Dilrukshi
<sdddilrukshi@gmail.com> wrote:
> I am using cassandra-jdbc driver and following is my code snip written for
> delete a entry from column family.

Where did you get this driver?  Is it a release, is it from git (and
if so, when/which ID?).  What version of Cassandra are you testing
against?

> String query1 = "delete from USER where key=?";
> PreparedStatement stmt = con.prepareStatement(query1);
> stmt.setString(1, "dinusha");
> stmt.execute();
>
> But I am getting following exception when it executes.
>
> java.sql.SQLSyntaxErrorException: line 1:27 no viable alternative at
> character '?'
> at
> org.apache.cassandra.cql.jdbc.CassandraStatement.doExecute(CassandraStatement.java:173)
> at
> org.apache.cassandra.cql.jdbc.CassandraStatement.executeUpdate(CassandraStatement.java:230)
> at
> org.apache.cassandra.cql.jdbc.CassandraPreparedStatement.executeUpdate(CassandraPreparedStatement.java:273)
>
> This is not only with delete statement, I have experience this with UPDATE
> statement as well.
>
> Greatly appreciate if anyone can advice to overcome this problem?
>
> Regards,
> ~Dinusha~
>



-- 
Eric Evans
Acunu | http://www.acunu.com | @acunu

Mime
View raw message