I am new to Cassandra. I implemented a Java Cassandra Connector in each method a new cluster will be build and end of the method I close it.
Usually you open the connection once per application, keep it open, reuse the session object (the
connect method returns that object) all over the places in the application, and you apply this criteria until you are done with the cluster. I mean, when your application finishes its work: you close both session and cluster only when your application quits or you need to release resources for a while. That's how the driver is supposed to be used.
Please find more on DataStax site