Search code examples
cassandradatastaxcqldatastax-java-driver

Cassandra PreparedStatement with static values


Is there any benefit of binding a field with static value when using a Cassandra PreparedStatement?

For Example should status also have a bind variable even if I am always going to use a static value 'Active' there? If yes why?

UPDATE users SET status='Active' WHERE user_id=:userid


Solution

  • if you always have the same statement with hardcoded attribute, then you aren't forced to use placeholder for it. Only if you have some queries where you have status != Active, then it make sense to use placeholder for status