Skip to content

Commit

Permalink
Fix issue #242 (#243)
Browse files Browse the repository at this point in the history
Cast the connection to JdbcConnection, then the underlying connection to CassandraConnection
to retrieve the keyspace.
  • Loading branch information
maximevw authored Dec 7, 2023
1 parent bee10db commit aca934b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ public String getCurrentDateTimeFunction() {
public String getKeyspace() {
if (keyspace == null) {
try {
keyspace = ((CassandraConnection) (this).getConnection()).getSession().getKeyspace().toString();
if (this.getConnection() instanceof JdbcConnection) {
keyspace = ((CassandraConnection) ((JdbcConnection) this.getConnection())
.getUnderlyingConnection()).getSchema();
}
} catch (Exception e) {
Scope.getCurrentScope().getLog(CassandraDatabase.class)
.severe("Could not get keyspace from connection", e);
Expand Down

0 comments on commit aca934b

Please sign in to comment.