📜  Cassandra-参考的Api

📅  最后修改于: 2020-12-02 06:13:33             🧑  作者: Mango


本章涵盖了Cassandra中的所有重要类。

此类是驱动程序的主要入口点。它属于com.datastax.driver.core软件包。

方法

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类。

方法

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.

届会

此接口保存与Cassandra群集的连接。使用此接口,您可以执行CQL查询。它属于com.datastax.driver.core软件包。

方法

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.