This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Determine if Apache Cassandra database connection is open


val = isopen(conn)



val = isopen(conn) returns 1 if the Cassandra® database connection is open and 0 if it is closed.


collapse all

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)
val = logical

The database connection is open because the isopen function returns 1. Otherwise, the database connection is closed.

Display the keyspaces in the Cassandra database.

ans = 1×6 string array
    "employeedata"    "system"    "system_auth"    "system_distributed"    "system_schema"    "system_traces"

Close the Cassandra database connection.


Verify that the Cassandra database connection is closed.

val = isopen(conn)
val = logical

Input Arguments

collapse all

Cassandra database connection, specified as a cassandra object.

Introduced in R2018b