-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Hibernate HQL Issue
PostPosted: Wed Apr 07, 2004 10:45 am 
Beginner
Beginner

Joined: Sun Mar 28, 2004 7:18 pm
Posts: 26
Hi guys,

I am using Weblogic portal and Hibernate 2.1

I am writing a Java control in Weblogic portal (in the web directory) that makes a call to Hiberate to retrieve an object from the database. Here is the code :

result = sess.find("from com.accidentfund.common.db.hibernate.PolicyDim as policy where policy.policyNumber = ?",
vo.getPolicyNum(),
Hibernate.STRING);

I get back :

net.sf.hibernate.JDBCException: Could not execute query

Is this because I am specifying the entire classpath for the PolicyDim class when I should not be ? I have hibernate.show_sql=true in the properties file, but I dont see the sql being printed anywhere...where does it get printed ?

The reason I was giving the entire classpath was :

a) Cos all the examples in the hibernate doc show x.y formats in HQL, so I assumed that giving the entire classpath was necessary.

b) Since I am making calls to Hibernate classes from a different directory than where the class files reside, I thought I should be passing in the classpath.

Can someone tell me why the HQL is not working ?
Also, how do I see the sql that hibernate generates once I put hibernate.show_sql=true in my hibernate.properties file ?

Thanks,
Suman


Top
 Profile  
 
 Post subject: Re: Hibernate HQL Issue
PostPosted: Thu Apr 08, 2004 8:09 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
suman wrote:
Is this because I am specifying the entire classpath for the PolicyDim class when I should not be ?

No, check the cause exception in your stacktrace

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.