Cassandra - Referenced Api




Cassandra - Referenced Api

This chapter covers all the important classes in Cassandra.

Cluster

This class is the main entry point of the driver. It belongs to com.datastax.driver.core package.

Methods

S. No. Methods and Description
1

Session connect()

It creates a new session on the current cluster and initializes it.

2

void close()

It is used to close the cluster instance.

3

static Cluster.Builder builder()

It is used to create a new Cluster.Builder instance.

Cluster.Builder

This class is used to instantiate the Cluster.Builder class.

Methods

S. No Methods and Description
1

Cluster.Builder addContactPoint(String address)

This method adds a contact point to cluster.

2

Cluster build()

This method builds the cluster with the given contact points.

Session

This interface holds the connections to Cassandra cluster. Using this interface, you can execute CQL queries. It belongs to com.datastax.driver.core package.

Methods

S. No. Methods and Description
1

void close()

This method is used to close the current session instance.

2

ResultSet execute(Statement statement)

This method is used to execute a query. It requires a statement object.

3

ResultSet execute(String query)

This method is used to execute a query. It requires a query in the form of a String object.

4

PreparedStatement prepare(RegularStatement statement)

This method prepares the provided query. The query is to be provided in the form of a Statement.

5

PreparedStatement prepare(String query)

This method prepares the provided query. The query is to be provided in the form of a String.



Frequently Asked Questions

+
Ans: Cassandra - Installation view more..
+
Ans: Cassandra - Data Model view more..
+
Ans: Cassandra - Architecture view more..
+
Ans: Cassandra - Referenced Api view more..
+
Ans: Cassandra - Cqlsh view more..
+
Ans: Cassandra - Shell Commands view more..
+
Ans: Cassandra - Create Keyspace view more..
+
Ans: Cassandra - Alter Keyspace view more..
+
Ans: Cassandra - Drop Keyspace view more..
+
Ans: Cassandra - Create Table view more..
+
Ans: Cassandra - Alter Table view more..
+
Ans: Cassandra - Drop Table view more..
+
Ans: Cassandra - Truncate Table view more..
+
Ans: Cassandra - Create Index view more..
+
Ans: Cassandra - Drop Index view more..
+
Ans: Cassandra - Batch Statements view more..
+
Ans: Cassandra - Create Data view more..
+
Ans: Cassandra - Create Data view more..




Rating - NAN/5
502 views

Advertisements