org.hibernate.exception.SQLGrammarException: could not prepare statement

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,
Expert tip

Check if you're not creating unused SQL entities, as it might cause this exception.

Solutions on the web

via Hibernate JIRA by Anders Wallgren, 1 year ago
could not prepare statement
via Hibernate JIRA by Anders Wallgren, 1 year ago
could not prepare statement
via Stack Overflow by A B
, 2 years ago
could not execute query
via Stack Overflow by Sandeep
, 2 years ago
ERROR: relation "public.service_provider" does not exist Position: 659
org.hibernate.exception.SQLGrammarException: could not prepare statement
at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
at org.h2.message.DbException.get(DbException.java:167)
at org.h2.message.DbException.get(DbException.java:144)
at org.h2.command.Parser.readTableColumn(Parser.java:632)
at org.h2.command.Parser.parseUpdate(Parser.java:664)
at org.h2.command.Parser.parsePrepared(Parser.java:413)
at org.h2.command.Parser.parse(Parser.java:274)
at org.h2.command.Parser.parse(Parser.java:246)
at org.h2.command.Parser.prepare(Parser.java:200)
at org.h2.command.Parser.prepareCommand(Parser.java:213)
at org.h2.engine.Session.prepareLocal(Session.java:423)
at org.h2.engine.Session.prepareCommand(Session.java:373)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1056)
at org.h2.jdbc.JdbcPreparedStatement.(JdbcPreparedStatement.java:71)
at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:233)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$1.doPrepare(StatementPreparerImpl.java:98)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:182)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:188)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareStatement(StatementPreparerImpl.java:91)
at org.hibernate.hql.spi.TableBasedUpdateHandlerImpl.execute(TableBasedUpdateHandlerImpl.java:163)
at org.hibernate.hql.internal.ast.exec.MultiTableUpdateExecutor.execute(MultiTableUpdateExecutor.java:65)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.executeUpdate(QueryTranslatorImpl.java:415)
at org.hibernate.engine.query.spi.HQLQueryPlan.performExecuteUpdate(HQLQueryPlan.java:282)
at org.hibernate.internal.SessionImpl.executeUpdate(SessionImpl.java:1290)
at org.hibernate.test.batch.joinedInheritence.BatchVersionedUpdateOfJoinedHierarchyTest.testUpdateVersionedWithWhereClause(BatchVersionedUpdateOfJoinedHierarchyTest.java:42)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)

Users with the same issue

Once, 1 year ago
Once, 9 months ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Once, 5 months ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago
152 more bugmates

Know the solutions? Share your knowledge to help other developers to debug faster.