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 6D3D19E5D for ; Wed, 16 Nov 2011 09:37:08 +0000 (UTC) Received: (qmail 19695 invoked by uid 500); 16 Nov 2011 09:37:06 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 19668 invoked by uid 500); 16 Nov 2011 09:37:06 -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 19659 invoked by uid 99); 16 Nov 2011 09:37:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Nov 2011 09:37:06 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of nilabja.banerjee@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; Wed, 16 Nov 2011 09:36:59 +0000 Received: by vws16 with SMTP id 16so303373vws.31 for ; Wed, 16 Nov 2011 01:36:38 -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=3+VuTx+X2GxMgsJUO+4DGpy1QTGhXvbRTBwW5jrGb2Q=; b=vQ3M1M5VqaGTxm5BdIzxp8Ie5HsMLLpRnZQkz56eFHv1MKnUQHnuib+/drHPy9Z8/+ jCxFbKChBw3q/o+ZV/C8z38k/4EL697kAgoJrD1jYsWK/LAS359M9P8czIPSvDTNbdLo 1xsCLxncuKAV3R7Qbs3/pKdXbBaZ1nmnHyOsA= MIME-Version: 1.0 Received: by 10.52.23.20 with SMTP id i20mr49366982vdf.93.1321436198696; Wed, 16 Nov 2011 01:36:38 -0800 (PST) Received: by 10.220.194.204 with HTTP; Wed, 16 Nov 2011 01:36:38 -0800 (PST) In-Reply-To: References: Date: Wed, 16 Nov 2011 15:06:38 +0530 Message-ID: Subject: Re: Cassandra JDBC From: Nilabja Banerjee To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=20cf3079b87037757a04b1d6d7fb X-Virus-Checked: Checked by ClamAV on apache.org --20cf3079b87037757a04b1d6d7fb Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Try this.... it should work...... import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class InsertData { public static void main(String[] args) throws ClassNotFoundException, SQLException{ Class.forName("org.apache.cassandra.cql.jdbc.CassandraDriver"); Connection jdbcConn =3D DriverManager .getConnection("jdbc:cassandra:/@localhost:9160/test"); Statement stmt =3D jdbcConn.createStatement(); ResultSet reset =3D stmt.executeQuery("select * from users"); jdbcConn.close(); } } On 16 November 2011 13:55, Jone Lura wrote: > Hi, > > I downloaded the cassandra-jdbc and built with maven. > > And when I am trying to use it in my application I get an exception on th= e > following code: > > java.sql.Connection conn =3D DriverManager.getConnection( > "jdbc:cassandra://localhost:9160/MyKeyspace"); > > java.lang.IncompatibleClassChangeError: Implementing class > at java.lang.ClassLoader.defineClass1(Native Method) > at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) > > =85 > > Does anyone have an idea what it might be? > > > Best regards, > > > Jone > > > > > --20cf3079b87037757a04b1d6d7fb Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Try this.... it should work......

import java.sql.Connection;
im= port java.sql.DriverManager;
import java.sql.ResultSet;
import java.s= ql.SQLException;
import java.sql.Statement;

public class InsertDa= ta {
=A0=A0=A0 public static void main(String[] args) throws ClassNotFoundExcept= ion, SQLException{
=A0=A0=A0 Class.forName("org.apache.cassandra.cq= l.jdbc.CassandraDriver");
=A0=A0=A0 =A0=A0 Connection jdbcConn =3D = DriverManager
=A0=A0=A0 =A0=A0=A0=A0 .getConnection("jdbc:cassandra= :/@localhost:9160/test");
=A0=A0=A0 =A0=A0 Statement stmt =3D jdbcConn.createStatement();
=A0=A0= =A0=A0=A0=A0 ResultSet reset =3D stmt.executeQuery("select * from user= s");
=A0=A0=A0=A0=A0=A0
=A0=A0=A0=A0=A0=A0 jdbcConn.close();=A0=A0=A0 }

}


On 16 November 2011 13:55, Jone Lura <jone.lura@ecc.no> wrote:
Hi,

I downloaded the= cassandra-jdbc and built with maven.

And when I a= m trying to use it in my application I get an exception on the following co= de:

java.= sql.Connection conn=A0=3D DriverManager.getConnection("jdb= c:cassandra://localhost:9160/MyKeyspac= e");

java.lang.IncompatibleClassChangeError: Implementi=
ng class
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
 =
       =85
Does anyone have an idea what it might be?

Best regards,

Jone




--20cf3079b87037757a04b1d6d7fb--