%% Create Cassandra Database Connection Using Authentication
% Using a local host address and authentication, create a Cassandra® database connection and display the keyspaces in the database.
%
% Create a Cassandra database connection using the local host address, user name, and password.

contactPoints = "localhost";
username = "username";
password = "password";
conn = cassandra(contactPoints,username,password)

% conn is a cassandra object that contains these properties:
% Cluster name
% Host address
% Local data center name
% Keyspaces
%
% Display the keyspaces in the Cassandra database by accessing the Keyspaces property of the cassandra object.

conn.Keyspaces

%
% Close the Cassandra database connection.

close(conn)

% Copyright 2018 The MathWorks, Inc.