Question

What is essential difference between these methods?

query() of JdbcTemplate and createQuery() of EntityManager?

As I understand, both execute query?

Was it helpful?

Solution

JdbcTemplate.query() executes a raw SQL query via Spring's JDBC API

EntityManager.createQuery() creates, but does not execute, a JPA query, via the native JPA API.

Same end result, very different mechanism.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top