Java

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>
Look for the most recent version at https://github.com/datastax/java-driver.

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; ...

Get Seven NoSQL Databases in a Week now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.