Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2FF499658 for ; Thu, 8 Dec 2011 15:53:44 +0000 (UTC) Received: (qmail 52008 invoked by uid 500); 8 Dec 2011 15:53:41 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 51983 invoked by uid 500); 8 Dec 2011 15:53:41 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 51975 invoked by uid 99); 8 Dec 2011 15:53:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Dec 2011 15:53:41 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of sdddilrukshi@gmail.com designates 209.85.212.44 as permitted sender) Received: from [209.85.212.44] (HELO mail-vw0-f44.google.com) (209.85.212.44) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Dec 2011 15:53:34 +0000 Received: by vbbez10 with SMTP id ez10so1638675vbb.31 for ; Thu, 08 Dec 2011 07:53:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=vz37CXAbZB9BQPgW0NtLlUh6HuRMXuryy35Np62jskU=; b=TSIHGpibDLwnUsfmNeKcCOpvrJ9Yk+d9AvmJzQSZ9ZHEzmhQSju6+oeLRJaGmvTl2J zdrI6pc32AIHAx1zq7qEdhB+XQLChvU6fCSVdM4YcErQNUSIVB6ImTYq3pXHHqpBHY/e Ba9iydTOqAVyd0EjzSIA7YT9AS47YvN0I2EJA= MIME-Version: 1.0 Received: by 10.52.174.46 with SMTP id bp14mr2111958vdc.107.1323359594095; Thu, 08 Dec 2011 07:53:14 -0800 (PST) Received: by 10.52.36.173 with HTTP; Thu, 8 Dec 2011 07:53:14 -0800 (PST) In-Reply-To: References: Date: Thu, 8 Dec 2011 21:23:14 +0530 Message-ID: Subject: Re: Cassandra jdbc-driver: no viable alternative at character '?' From: Dinusha Dilrukshi To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=bcaec51b9db184227904b396aa44 X-Virus-Checked: Checked by ClamAV on apache.org --bcaec51b9db184227904b396aa44 Content-Type: text/plain; charset=ISO-8859-1 Hi Evans, On Thu, Dec 8, 2011 at 8:59 PM, Eric Evans wrote: > On Thu, Dec 8, 2011 at 4:20 AM, Dinusha Dilrukshi > 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 > --bcaec51b9db184227904b396aa44 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Evans,


On Thu, Dec 8, 2011 at 8:5= 9 PM, Eric Evans <= eevans@acunu.com> wrote:
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? =A0Is it a release, is it from git (an= d
if so, when/which ID?). =A0What 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.=A0

> String query1 =3D "delete from USER where key=3D?";
> PreparedStatement stmt =3D 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(CassandraSt= atement.java:173)
> at
> org.apache.cassandra.cql.jdbc.CassandraStatement.executeUpdate(Cassand= raStatement.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 UP= DATE
> statement as well.
>
> Greatly appreciate if anyone can advice to overcome this problem?
>
> Regards,
> ~Dinusha~
>



--
Eric Evans
Acunu |=A0http://www.acu= nu.com=A0| @acunu

--bcaec51b9db184227904b396aa44--