Re: Cassandra jdbc-driver: no viable alternative at character '?'

2011-12-08 Thread Eric Evans
On Thu, Dec 8, 2011 at 4:20 AM, Dinusha Dilrukshi
sdddilruk...@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


Re: Cassandra jdbc-driver: no viable alternative at character '?'

2011-12-08 Thread Dinusha Dilrukshi
Hi Evans,


On Thu, Dec 8, 2011 at 8:59 PM, Eric Evans eev...@acunu.com wrote:

 On Thu, Dec 8, 2011 at 4:20 AM, Dinusha Dilrukshi
 sdddilruk...@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?


This is not a released one. I build it from source and checkout was taken
on 18-11-2011. And also I'm using Cassandra-1.0.0 version.

Regards,
Dinusha.


  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