• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error

 
sojan chandy
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javax.servlet.jsp.JspTagException: org.hibernate.exception.SQLGrammarException: could not execute query

i don kno what actually happening...

someone changed the name of database or somtning..i dont kno where the problem is....


plzzz help me
 
Jeff Ash
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The exception you referred to, org.hibernate.exception.SQLGrammarException, is a Hibernate class. Your best bet is to refer to the Hibernate documentation for complete details.

However, I've experienced similar issue since I use Hibernate in our products. The Hibernate exceptions like this one have a method called getSQLException(). This will return a standard java.sql.SQLException instance that contains the actual error from the database.

Depending on the underlying database, you may need to examine the result of the getNextException() call on the java.sql.SQLException to get the lowest, most detailed message, but that is easy enough to do. Here is some code that I use in one of my apps. It uses DataException, but SQLGrammarException works basically the same:
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have a separate forum for Hibernate questions - the object/relational forum. I'll move this there for you as you will find people who know Hibernate rather than just JDBC.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic