This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Other Application Frameworks and the fly likes problem with t Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "problem with t" Watch "problem with t" New topic
Author

problem with t

NareshAnkuskani Kumar
Ranch Hand

Joined: Sep 15, 2005
Posts: 76
Hi all,

i am using spring with hibernate. During this process while executing the query

StringBuffer hqlQuery = new StringBuffer();
hqlQuery.append("select emp from EMP emp where ");
hqlQuery.append("emp.name = ?");
return this.getHibernateTemplate().find(hqlQuery.toString(),firstName);

i am facing the problem mentioned below.

org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not execute query; uncategorized SQLException for SQLConversion to internal representation not successfully

please can anY one help me in sorting this out?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17276
    
    6

Um, I don't think find() runs String queries. I think it is mapped to the get or load method of a session. You want to run an actual query, which is a different method of the HibernateTemplate, it might just be called query(), I don't remember the exact method name.

Mark


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
 
Consider Paul's rocket mass heater.
 
subject: problem with t
 
jQuery in Action, 3rd edition