aspose file tools
The moose likes Object Relational Mapping and the fly likes error Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply Bookmark "error " Watch "error " New topic
Author

error

sojan chandy
Greenhorn

Joined: Mar 18, 2007
Posts: 24
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

Joined: Apr 07, 2007
Posts: 11
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:


Jeff Ash<br /><a href="http://www.excellentiasoftware.com" target="_blank" rel="nofollow">Excellentia Software</a>
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 26192
    
  66

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: error
 
Similar Threads
http 404 status error
Request in sessionDestroyed of HttpSessionListener
change password
please :::::::aquestion
Re: java projects