diff --git a/src/main/java/liquibase/ext/cassandra/database/CassandraDatabase.java b/src/main/java/liquibase/ext/cassandra/database/CassandraDatabase.java index 31d8606a..1f3c50f2 100644 --- a/src/main/java/liquibase/ext/cassandra/database/CassandraDatabase.java +++ b/src/main/java/liquibase/ext/cassandra/database/CassandraDatabase.java @@ -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);