title: Cassandra is throwing NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1 (null))
body: <p>I am not able to connect to Cassandra cluster using this code:</p>
  
  <pre><code>public static boolean tableCreate() {
          // Query
          String query = "CREATE KEYSPACE store WITH replication "
                  + "= {'class':'SimpleStrategy', 'replication_factor':1};";
  
          // creating Cluster object
          Cluster cluster = Cluster.builder().addContactPoint("127.0.0.1").withPort(9042).build();
  
          // Creating Session object
          Session session = cluster.connect("tutorialspoint");
  
          // Executing the query
          session.execute(query);
  
          // using the KeySpaceq
          session.execute("USE store");
          System.out.println("Keyspace created with store name");
  
          return true;
      }
  </code></pre>
  
  <p>It is giving me this error:</p>
  
  <pre><code>Exception in thread "main" com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1 (null))
  </code></pre>
  
  <p>What is my mistake in the code above?</p>
  
  <p>Cassandra is running on my Local Windows 10 64bit and I also disabled the firewall.</p>