<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>DataStax Support Forums &#187; Tag: JDBC driver - Recent Posts</title>
		<link>http://www.datastax.com/support-forums/tags/jdbc-driver</link>
		<description>Software, Support, and Training for Apache Cassandra</description>
		<language>en-US</language>
		<pubDate>Thu, 23 May 2013 19:05:40 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.3</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.datastax.com/support-forums/search.php</link>
		</textInput>
		<atom:link href="http://www.datastax.com/support-forums/rss/tags/jdbc-driver" rel="self" type="application/rss+xml" />

		<item>
			<title>Mutatio on "Cassandra JDBC Error"</title>
			<link>http://www.datastax.com/support-forums/topic/cassandra-jdbc-error#post-6165</link>
			<pubDate>Tue, 28 Aug 2012 10:54:18 +0000</pubDate>
			<dc:creator>Mutatio</dc:creator>
			<guid isPermaLink="false">6165@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;Oddly, my DataStax user account was purged.&#60;/p&#62;
&#60;p&#62;In regards to this problem, it's not non-existent with Cassandra 1.1.x from the Apache Debian repositories in conjunction with the latest Cassandra JDBC 1.1. It now works as expected.&#60;/p&#62;
&#60;p&#62;To above, use the version parameter in the connection string, like so:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;jdbc:cassandra://127.0.0.1:9160/myKeyspace?&#38;lt;strong&#38;gt;version=3.0.0&#38;lt;/strong&#38;gt;&#60;/code&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anonymous on "Flexible schema in CQL 3"</title>
			<link>http://www.datastax.com/support-forums/topic/flexible-schema-in-cql-3#post-2169</link>
			<pubDate>Thu, 14 Jun 2012 08:18:01 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">2169@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;Thanks every one for the reply!&#60;br /&#62;
 And, Thepaul, Exactly that is the place where I got the answer,&#60;br /&#62;
 If, you want to use CQL 3.0 using JDBC driver, while creating connection you have to add a few words,&#60;br /&#62;
connection = DriverManager.getConnection(&#34;jdbc:cassandra://localhost:9160/trial?version=3.0.0&#34;);&#60;/p&#62;
&#60;p&#62;I mean, you have to specify the version name there.&#60;/p&#62;
&#60;p&#62;Thanks every one again!!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>thepaul on "Flexible schema in CQL 3"</title>
			<link>http://www.datastax.com/support-forums/topic/flexible-schema-in-cql-3#post-2155</link>
			<pubDate>Wed, 13 Jun 2012 15:38:34 +0000</pubDate>
			<dc:creator>thepaul</dc:creator>
			<guid isPermaLink="false">2155@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;I wouldn't say cql 3 is still experimental.  It's not even beta anymore.  It ought to be as stable, or more, than cql 2 at this point.&#60;/p&#62;
&#60;p&#62;Version 1.1.0 of the JDBC driver (still in development) will support cql 3: see &#60;a href=&#34;http://code.google.com/a/apache-extras.org/p/cassandra-jdbc/source/detail?spec=svn611a4f8def98d231d5aa80468c1e729a91f9259f&#38;#038;name=trunk&#38;#038;r=34afe6507c945ecc17fe0c2db68c1715f83af0f0&#34; rel=&#34;nofollow&#34;&#62;http://code.google.com/a/apache-extras.org/p/cassandra-jdbc/source/detail?spec=svn611a4f8def98d231d5aa80468c1e729a91f9259f&#38;#038;name=trunk&#38;#038;r=34afe6507c945ecc17fe0c2db68c1715f83af0f0&#60;/a&#62; .&#60;/p&#62;
&#60;p&#62;So if you really need it, try the v1.1.0 branch of cassandra-jdbc.&#60;/p&#62;
&#60;p&#62;The python driver supports cql 3 now, if that helps.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anonymous on "Flexible schema in CQL 3"</title>
			<link>http://www.datastax.com/support-forums/topic/flexible-schema-in-cql-3#post-2138</link>
			<pubDate>Wed, 13 Jun 2012 10:20:17 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">2138@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;I don't believe that you can do that in current situation when CQL3 is still being experimental, the only way I know to run cql3 is to run cqlsh from C* bin directory with --cql3 flag.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anonymous on "Flexible schema in CQL 3"</title>
			<link>http://www.datastax.com/support-forums/topic/flexible-schema-in-cql-3#post-2131</link>
			<pubDate>Wed, 13 Jun 2012 03:45:48 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">2131@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;I am new to cassandra. As, I read many posts, most of them prescribe CQL 3.0. As I am a Java developer, I was trying cassandra using JDBC driver and Hector( using cql queries) to connect to database. But, I don't know how to upgrade those to CQL 3, and CQL 3 queries are not accepted by these frameworks. So, can somebody help me out of it with some examples.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anonymous on "Cassandra JDBC Error"</title>
			<link>http://www.datastax.com/support-forums/topic/cassandra-jdbc-error#post-2117</link>
			<pubDate>Tue, 12 Jun 2012 09:19:23 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">2117@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;How to use CQL 3.0 with JDBC driver.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anonymous on "Flexible schema in CQL 3"</title>
			<link>http://www.datastax.com/support-forums/topic/flexible-schema-in-cql-3#post-2025</link>
			<pubDate>Sun, 03 Jun 2012 20:13:00 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">2025@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;No, it wouldn't hurt anything, only this you would have to do to work with columns that are not in metadata is to use Thrift or CQL2.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anonymous on "Flexible schema in CQL 3"</title>
			<link>http://www.datastax.com/support-forums/topic/flexible-schema-in-cql-3#post-2024</link>
			<pubDate>Sun, 03 Jun 2012 18:31:04 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">2024@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;I just started with Cassandra a few weeks ago.  One of the things I really like about it is the ability to add columns on the fly. Is it a valid assertion that 'dynamic' tables do not exist in cql 3.0?&#60;/p&#62;
&#60;p&#62;If I modify my code to catch the exception (unidentified column, or whatever it's called) and alter the columnfamily during insertion, is that sufficient?  Put another way, if I end up with a columnfamily with a thousand columns defined in meta-data, but only a dozen used on each table, will that 'hurt' things?&#60;/p&#62;
&#60;p&#62;---greg
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anonymous on "Cassandra JDBC Error"</title>
			<link>http://www.datastax.com/support-forums/topic/cassandra-jdbc-error#post-1959</link>
			<pubDate>Tue, 22 May 2012 13:43:59 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">1959@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;Sorry for the lack of response, I'll look into this again in the next few days.&#60;/p&#62;
&#60;p&#62;I did notice when executing my build scripts that JDBC had a new 1.1 branch (I'm already using trunk), on first glance I assumed it was just created to align with the new stable Cassandra 1.1 release.&#60;/p&#62;
&#60;p&#62;The latest revision looks promising but then again POM/Build dependencies have been updated in line with 1.1* since March.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>thepaul on "Flexible schema in CQL 3"</title>
			<link>http://www.datastax.com/support-forums/topic/flexible-schema-in-cql-3#post-1925</link>
			<pubDate>Wed, 16 May 2012 16:40:26 +0000</pubDate>
			<dc:creator>thepaul</dc:creator>
			<guid isPermaLink="false">1925@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;Yes, CQL 3 expects all columns to be defined in the metadata. What you should do about this depends on why you want col1 to exist. If it's the only extra column, then naturally you just need to add it to the metadata (something like &#60;code&#62;alter table mytab add col1 text;&#60;/code&#62;.&#60;/p&#62;
&#60;p&#62;But note that CQL 3 rows are not necessarily the same as the underlying Cassandra rows (&#34;storage engine rows&#34;).  So if your col1 is meant to be an example of a whole other set of ordered arbitrary column names and values that you'll be inserting, the right way to represent that in CQL might be to have a parallel table of &#34;attributes&#34; (or whatever):&#60;/p&#62;
&#60;p&#62;Example:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;CREATE TABLE mytab_attrs (
    key text,
    attribute_name text,
    attribute_value text,
    PRIMARY KEY (key, attribute_name)
) WITH COMPACT STORAGE;

INSERT INTO mytab (key, full_name, email)
    VALUES (&#38;#039;key1&#38;#039;, &#38;#039;Person 1&#38;#039;, &#38;#039;person1@gmail.com&#38;#039;);
INSERT INTO mytab_attrs (key, attribute_name, attribute_value)
    VALUES (&#38;#039;key1&#38;#039;, &#38;#039;col1&#38;#039;, &#38;#039;value1&#38;#039;);&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Anonymous on "Flexible schema in CQL 3"</title>
			<link>http://www.datastax.com/support-forums/topic/flexible-schema-in-cql-3#post-1917</link>
			<pubDate>Tue, 15 May 2012 21:54:54 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">1917@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;We have a column family which has a few defined columns, and the rest are set at runtime.&#60;/p&#62;
&#60;p&#62;e.g.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;create column family mytab WITH comparator = UTF8Type AND key_validation_class=UTF8Type
AND default_validation_class = UTF8Type
AND column_metadata = [
{column_name: full_name, validation_class: UTF8Type}
{column_name: email, validation_class: UTF8Type}
{column_name: state, validation_class: UTF8Type}
{column_name: gender, validation_class: UTF8Type}
{column_name: birth_year, validation_class: LongType}
];

set mytab[&#38;#039;key1&#38;#039;][&#38;#039;full_name&#38;#039;]=&#38;#039;Person 1&#38;#039;;
set mytab[&#38;#039;key1&#38;#039;][&#38;#039;email&#38;#039;]=&#38;#039;person1@gmail.com&#38;#039;;
set mytab[&#38;#039;key1&#38;#039;][&#38;#039;col1&#38;#039;]=&#38;#039;value1&#38;#039;;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;As you can see, the 3rd insert creates a new column 'col1' (which is not defined in the column_metadata).&#60;br /&#62;
Now doing &#60;code&#62;list mytab&#60;/code&#62; from cassandra-cli, shows the extra column&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[default@keyspace01] list mytab;
Using default limit of 100
-------------------
RowKey: key1
=&#38;gt; (column=col1, value=76616c756531, timestamp=1337108844540000)
=&#38;gt; (column=email, value=person1@gmail.com, timestamp=1337108716202000)
=&#38;gt; (column=full_name, value=Person 1, timestamp=1337108708791000)&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Same goes for CQL 2.0&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;cqlsh:keyspace01&#38;gt; select * from mytab;
 KEY,key1 &#124; col1,76616c756531 &#124; email,person1@gmail.com &#124; full_name,Person 1&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;But I can't see 'col1' if using CQL 3.0&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$./cqlsh -3 cass01
Connected to OG Cluster at cass01:9160.
[cqlsh 2.2.0 &#124; Cassandra 1.1.0 &#124; CQL spec 3.0.0 &#124; Thrift protocol 19.30.0]
Use HELP for help.
cqlsh&#38;gt; use keyspace01;
cqlsh:keyspace01&#38;gt; select * from mytab;
 key  &#124; birth_year &#124; email             &#124; full_name &#124; gender &#124; state
------+------------+-------------------+-----------+--------+-------
  key &#124;       null &#124;              null &#124;      null &#124;   null &#124;  null
 key1 &#124;       null &#124; &#60;a href=&#34;mailto:person1@gmail.com&#34;&#62;person1@gmail.com&#60;/a&#62; &#124;  Person 1 &#124;   null &#124;  null&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Is this the intended behavior in CQL 3.0. coz having this flexibility is very&#60;br /&#62;
important to us, which means we can't use CQL 3.0
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anonymous on "Cassandra JDBC Error"</title>
			<link>http://www.datastax.com/support-forums/topic/cassandra-jdbc-error#post-1810</link>
			<pubDate>Tue, 01 May 2012 17:29:02 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">1810@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;I'm seeing this issue as well with Cassandra 1.1. &#60;/p&#62;
&#60;p&#62;I tried inlining the values instead of using a PreparedStatement.  That did work, but isn't a workable long-term solution.&#60;/p&#62;
&#60;p&#62;I'm using the latest JDBC source from the git repository.&#60;/p&#62;
&#60;p&#62;Any thoughts before I go additional digging?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>joaquin on "Cassandra JDBC Error"</title>
			<link>http://www.datastax.com/support-forums/topic/cassandra-jdbc-error#post-1696</link>
			<pubDate>Wed, 18 Apr 2012 19:28:17 +0000</pubDate>
			<dc:creator>joaquin</dc:creator>
			<guid isPermaLink="false">1696@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;Also, could you try inlining the values for stmtInsertPost instead of setting them afterwards? What result does that give you?&#60;/p&#62;
&#60;p&#62;Thanks,&#60;br /&#62;
Joaquin
&#60;/p&#62;</description>
		</item>
		<item>
			<title>joaquin on "Cassandra JDBC Error"</title>
			<link>http://www.datastax.com/support-forums/topic/cassandra-jdbc-error#post-1695</link>
			<pubDate>Wed, 18 Apr 2012 19:23:25 +0000</pubDate>
			<dc:creator>joaquin</dc:creator>
			<guid isPermaLink="false">1695@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;Perhaps you should try running this code from jdbc's trunk branch:&#60;br /&#62;
&#60;a href=&#34;http://code.google.com/a/apache-extras.org/p/cassandra-jdbc/source/list?name=trunk&#34; rel=&#34;nofollow&#34;&#62;http://code.google.com/a/apache-extras.org/p/cassandra-jdbc/source/list?name=trunk&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;There have been recent commits specifically for 1.1. &#60;/p&#62;
&#60;p&#62;Do let us know if this helps,&#60;br /&#62;
Joaquin
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anonymous on "Cassandra JDBC Error"</title>
			<link>http://www.datastax.com/support-forums/topic/cassandra-jdbc-error#post-1462</link>
			<pubDate>Thu, 29 Mar 2012 18:19:51 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">1462@http://www.datastax.com/support-forums/</guid>
			<description>&#60;p&#62;Has anybody managed to get the Cassandra JDBC 1.0.5 to work with Cassandra 1.1+?&#60;/p&#62;
&#60;p&#62;Using these &#34;schemas&#34;:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;CREATE KEYSPACE mutatio WITH strategy_class = &#38;#039;SimpleStrategy&#38;#039; AND strategy_options:replication_factor = 1;

USE mutatio;

CREATE COLUMNFAMILY blogPosts (
	id bigint PRIMARY KEY,
	userID int,
	title varchar,
	body text,
	created timestamp,
	edited timestamp
);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;And query like so (connecting to Cassandra is fine):&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;try {
	PreparedStatement stmtInsertPost = cassandra.prepareStatement(&#38;quot;UPDATE blogPosts SET userID=?, title=?, body=?, created=?, edited=? WHERE id=?&#38;quot;);

	byte i = 0;

	stmtInsertPost.setInt(i++, post.userID);
	stmtInsertPost.setString(i++, post.title);
	stmtInsertPost.setString(i++, post.body);
	stmtInsertPost.setString(i++, post.created);
	stmtInsertPost.setString(i++, post.edited);
	stmtInsertPost.setLong(i++, post.id);
	stmtInsertPost.executeUpdate();
} catch (Exception ex) {
	writer.println(ex.toString());
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Example object:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;{
  &#38;quot;id&#38;quot; : 2339993644662819568,
  &#38;quot;userID&#38;quot; : 1,
  &#38;quot;created&#38;quot; : &#38;quot;2012-03-29 19:15:46+0100&#38;quot;,
  &#38;quot;edited&#38;quot; : &#38;quot;2012-03-29 19:15:46+0100&#38;quot;,
  &#38;quot;body&#38;quot; : &#38;quot;&#38;lt;p&#38;gt;Hello World!&#38;lt;/p&#38;gt;&#38;quot;,
  &#38;quot;title&#38;quot; : &#38;quot;Test Blog Post&#38;quot;,
  &#38;quot;tags&#38;quot; : [ &#38;quot;test&#38;quot;, &#38;quot;testing&#38;quot; ]
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I get a generic SQL exception in the Java application (I'm using Apache DBCP) and by running ./cassandra -f I can see this exception:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;ERROR 19:02:01,587 Error occurred during processing of message.
java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
	at java.util.ArrayList.rangeCheck(ArrayList.java:604)
	at java.util.ArrayList.get(ArrayList.java:382)
	at org.apache.cassandra.cql.Term.getByteBuffer(Term.java:99)
	at org.apache.cassandra.cql.UpdateStatement.prepareRowMutations(UpdateStatement.java:163)
	at org.apache.cassandra.cql.UpdateStatement.prepareRowMutations(UpdateStatement.java:127)
	at org.apache.cassandra.cql.QueryProcessor.batchUpdate(QueryProcessor.java:252)
	at org.apache.cassandra.cql.QueryProcessor.processStatement(QueryProcessor.java:591)
	at org.apache.cassandra.cql.QueryProcessor.process(QueryProcessor.java:873)
	at org.apache.cassandra.thrift.CassandraServer.execute_cql_query(CassandraServer.java:1226)
	at org.apache.cassandra.thrift.Cassandra$Processor$execute_cql_query.getResult(Cassandra.java:3458)
	at org.apache.cassandra.thrift.Cassandra$Processor$execute_cql_query.getResult(Cassandra.java:3446)
	at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:32)
	at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:34)
	at org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:184)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:722)&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Has anybody experienced this and discovered a solution or is it simply a mismatch of edge build of Cassandra conflicting with the Cassandra-JDBC which doesn't seem to get updated all that often?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
