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 7C7939726 for ; Thu, 8 Dec 2011 15:29:51 +0000 (UTC) Received: (qmail 2003 invoked by uid 500); 8 Dec 2011 15:29:49 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 1964 invoked by uid 500); 8 Dec 2011 15:29:49 -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 1956 invoked by uid 99); 8 Dec 2011 15:29:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Dec 2011 15:29:48 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of eevans@acunu.com designates 209.85.210.44 as permitted sender) Received: from [209.85.210.44] (HELO mail-pz0-f44.google.com) (209.85.210.44) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Dec 2011 15:29:43 +0000 Received: by dajz8 with SMTP id z8so2437840daj.31 for ; Thu, 08 Dec 2011 07:29:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acunu.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=jqpMh6U2/Px8tDf8mkKVM9FsWmHbDzPGh/ZonQaQqsU=; b=d240E3bs8IFDefXHe/9hl49RKVodB8smA6ySPVzbb2Xynqo+M7MyA1YxNuLxhNzXCE Y0jbC7xwwWDiTIvpiJbRwC6rfb37J2EY4Af3uTVs7NBe/RwtHZziwKVo80UB5DOdAKNC uCw+q4bZ4D9tegTsh+S91L3jiMIihhjZkjuFs= MIME-Version: 1.0 Received: by 10.68.51.71 with SMTP id i7mr13113921pbo.26.1323358163169; Thu, 08 Dec 2011 07:29:23 -0800 (PST) Received: by 10.142.90.6 with HTTP; Thu, 8 Dec 2011 07:29:23 -0800 (PST) In-Reply-To: References: Date: Thu, 8 Dec 2011 09:29:23 -0600 Message-ID: Subject: Re: Cassandra jdbc-driver: no viable alternative at character '?' From: Eric Evans To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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 fo= r > 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 =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(CassandraState= ment.java:173) > at > org.apache.cassandra.cql.jdbc.CassandraStatement.executeUpdate(CassandraS= tatement.java:230) > at > org.apache.cassandra.cql.jdbc.CassandraPreparedStatement.executeUpdate(Ca= ssandraPreparedStatement.java:273) > > This is not only with delete statement, I have experience this with UPDAT= E > statement as well. > > Greatly appreciate if anyone can advice to overcome this problem? > > Regards, > ~Dinusha~ > --=20 Eric Evans Acunu |=A0http://www.acunu.com=A0| @acunu