Of course, applications using Java (and many other languages) can connect to, and work with, data in Cassandra. The easiest way to do so is with the DataStax Cassandra Java driver, via Apache Maven. To accomplish this, I'll create a new Maven project (naming it CassHelloWorld) with the following entries in the pom.xml:
<dependencies> <dependency> <groupId>com.datastax.cassandra</groupId> <artifactId>cassandra-driver-core</artifactId> <version>3.3.0</version> </dependency></dependencies>
Once that is done, we will create a class, named CassandraConnection, to handle our Cassandra connections:
import com.datastax.driver.core.Cluster; import com.datastax.driver.core.Session; ...