May 17, 2021 Cassandra
This chapter covers all the important classes in Cassandra.
This class is the driver's primary entry point. It belongs to the com.datastax.driver.core package.
Serial number | Method 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 cluster instances. |
3 |
static Cluster.Builder builder() It is used to create a new Cluster.Builder instance. |
This class is used to instantiate the Cluster.Builder class.
Serial number | Method and description |
---|---|
1 |
Cluster.Builder addContactPoint(String address) This method adds contacts to the cluster. |
2 |
Cluster build() This method uses a given touch point to build a cluster. |
This interface holds the connection to the Cassandra cluster. U sing this interface, you can perform CQL queries. It belongs to the com.datastax.driver.core package.
Serial number | Method 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 the query. It requires a statement object. |
3 |
ResultSet execute(String query) This method is used to execute the query. It requires a query in the form of a String object. |
4 |
PreparedStatement prepare(RegularStatement statement) The method prepares the query to be provided. The query will be provided as State. |
5 |
PreparedStatement prepare(String query) The method prepares the query to be provided. The query will be provided in the form of String. |