What is the connection URL to be used for Cassandra?
jdbc:cassandra:root/root@:/
If you're using cassandra-jdbc, the connection URL will be something like this:
jdbc:cassandra://host1--host2--host3:9160/keyspace1?primarydc=DC1&backupdc=DC2&consistency=QUORUM"
But if you do not have to use JDBC, I recommend you the DataStax Java-Driver. You will connect like this:
String serverIP = "127.0.0.1"; String keyspace = "system"; Cluster cluster = Cluster.builder() .addContactPoints(serverIP) .build(); Session session = cluster.connect(keyspace);
If you're using cassandra-jdbc, the connection URL will be something like this:
But if you do not have to use JDBC, I recommend you the DataStax Java-Driver. You will connect like this: