Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

org.hibernate.exception.GenericJDBCException: could not execute query

843785Sep 27 2008
Hi All,

I am developing a web service using Java 1.6 , Hibernate 3.0 , Axis 1.4 and Tomcat Apache 5.5.

My issue is that when i work with the "createCriteria" queries they works fine. But when i use "createSQLQuery" it raise the following exception

"org.hibernate.exception.GenericJDBCException: could not execute query"

and also some times without doing anyting code starts working but some times it gives the same exception.

I also get the following warning

"16:37:50,782 WARN Configurator:126 - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/D:/Workspace/encode/lib/ehcache-1.1.jar!/ehcache-failsafe.xml"

The code i am using is mentioned below

session = queueSessionFactory.openSession();

String sql = "SELECT * FROM queue WHERE status =:status AND assigned_to =:assigned_to";
SQLQuery query = session.createSQLQuery(sql).addEntity("queue", QueueBean.class);
query.setString("assigned_to", serverName);
query.setString("status","queued");
list = query.list();


Any help would be greatly appriciated.

-
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 25 2008
Added on Sep 27 2008
0 comments
1,038 views