1

I was working on a project and couldn't help but notice that it uses two different execute methods to trigger a query execution:

1> session.execute() 2> cassandraTemplate.execute() 

Could someone please explain the difference between the two?

Thanks!

1
  • Looking at the code of CqlTemplate, it seems that it uses the session object itself to execute the query! Commented Nov 2, 2018 at 5:14

1 Answer 1

2

You're confusing 2 things: session.execute is the method from DataStax Java driver that execute raw CQL string or statements. The cassandraTemplate.execute is the method from the Spring Data for Apache Cassandra that wraps DataStax Java driver and adds more functionality for better Spring integration - under the hood it uses session.execute.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.