incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Cobley <acob...@computing.dundee.ac.uk>
Subject JDBC : CreateresultSet fails with null column in CqlResultSet
Date Thu, 31 Jan 2013 14:25:54 GMT
As you may be aware I've been trying to track down a problem using JDBC 1.1.2 with Cassandra
1.2.0  I was getting a null pointer exception in the result set.  I've done some digging into
the JDBC driver  and found the following.

In CassandraResultSet.java the new result set is Instantiated in 
    
CassandraResultSet(Statement statement, CqlResult resultSet, String keyspace)

I decided to trace the result set with the following code:

rowsIterator = resultSet.getRowsIterator();
        System.out.println("-------------------------------");
        while(rowsIterator.hasNext()){
           CqlRow row = rowsIterator.next();
           curRowKey = row.getKey();
           System.out.println("Row Key "+curRowKey);
           List<Column> cols = row.getColumns();
           Iterator<Column> iterator;
           iterator = cols.iterator();     
	   while (iterator.hasNext()){
	       Column col=(Column)iterator.next();
	       String Name= new String(col.getName());
               String Value = new String(col.getValue());
	       System.out.println("Col "+Name+ " : "+Value);
	        }
        }

This produced the following output:

-------------------------------
Row Key [B@617e53c9
Col key : jsmith
Col 
Mime
View raw message