title: Passing variable value to cassandra cql statement
body: <p>I have Java code to access and process data in Cassandra. How do I pass a Java variable to Cassandra CQL query written in Java. Here is the code:</p>
  
  <p>My code goes like this:</p>
  
  <pre><code>itemname="Item01";
  
  com.datastax.driver.core.PreparedStatement result = 
  session.execute("select itemname from demodb.retail_transaction where itemnamw = itemname;");
  </code></pre>
  
  <p>But it gives the following error: </p>
  
  <pre><code>no viable alternative at input ';'
  </code></pre>