October 2018
Beginner to intermediate
348 pages
10h
English
Let's start by building a class to handle the connection to Apache Cassandra. We'll try to make this robust enough to be useful for each exercise to follow. First of all, let's specify our package (if it's not already specified), and import a few classes from the driver:
package PacktCassDev;import com.datastax.driver.core.Cluster;import com.datastax.driver.core.ConsistencyLevel;import com.datastax.driver.core.Session;import com.datastax.driver.core.policies.DCAwareRoundRobinPolicy;import com.datastax.driver.core.policies.TokenAwarePolicy;import com.datastax.driver.core.ResultSet;import com.datastax.driver.core.BoundStatement;import com.datastax.driver.core.QueryOptions;