%% Verify Cassandra Connection
% Using a Cassandra® database connection, verify that the connection is open. Display the keyspaces in the Cassandra database, and then close the connection.
%
% Create a Cassandra database connection using the local host address. conn is a cassandra object.

contactPoints = "localhost";
conn = cassandra(contactPoints);

%
% Verify that the Cassandra database connection is open.

val = isopen(conn)

% The database connection is open because the isopen function returns 1. Otherwise, the database connection is closed.
%
% Display the keyspaces in the Cassandra database.

conn.Keyspaces

%
% Close the Cassandra database connection.

close(conn)

%
% Verify that the Cassandra database connection is closed.

val = isopen(conn)

% Copyright 2018 The MathWorks, Inc.