If you're working on Spring boot application, there are high chances that you will use hibernate to map java objects to relational database. In such a case, JPA entities, which are pre-defined POJOs that can be stored in a database, are passed to a Spring-DAO which then uses hibernate to store the data.
Therefore, all the sql queries are handled by hibernate which eliminates the chances of getting syntax errors in sql statements.
Yet, I recently got org.hibernate.exception.SQLGrammarException: could not prepare statement
in my spring boot application, and I'm curious to know that,
- What does
org.hibernate.exception.SQLGrammarException: could not prepare statement
actually mean? And, - What are the possible reasons which can raise this exception(is it only related to SQL syntax or can it point to some other problem in the code)?