Quantcast
Channel: DataStax Support Forums » Recent Topics
Viewing all articles
Browse latest Browse all 387

affy on "Cassandra JDBC: Can jdbc.CassandraConnection provide a getter method to return the current keyspace?"

$
0
0

I am writing an application to access Cassandra 1.2.x servers using JDBC. I have a need to display the keyspace currently being used in our application but CQL does not seem to provide a command for this purpose. I noticed that org.apache.cassandra.cql.jdbc.CassandraConnection has a 'currentKeyspace' data member which will track the change from one keyspace to another via the USE command. However, 'currentKeyspace' is declared with package scope and there is no getter method available to access this variable. Is it possible to add a getter method for the 'currentKeyspace' data member in org.apache.cassandra.cql.jdbc.CassandraConnection?

I also noticed that CassandraResultSet.getMetaData().getSchemaName(int column) will return CassandraConnection.currentKeyspace to caller. But I'd like to avoid executing a query every time I need the current keyspace.

In addition, a keyspace name can be enclosed in double quotation marks and become case-sensitive. The current Cassandra JDBC implementation does not seem to handle this correctly: the KEYSPACE_PATTERN defined in org.apache.cassandra.cql.jdbc.Utils does not seem to take double quotes into consideration. Is this a bug?


Viewing all articles
Browse latest Browse all 387

Trending Articles