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:
My code goes like this:
itemname="Item01";
com.datastax.driver.core.PreparedStatement result =
session.execute("select itemname from demodb.retail_transaction where itemnamw = itemname;");
But it gives the following error:
no viable alternative at input ';'