-->
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.  [ 1 post ] 
Author Message
 Post subject: Problem in using Aggregate function
PostPosted: Wed Jan 30, 2008 2:25 am 
Newbie

Joined: Thu May 10, 2007 9:56 am
Posts: 1
Hi all,
I am getting exception while tyring to use Aggregate function as
follows in Hibernate3.0.
String SQL_QUERY = "select SUM(price) from
customer_account";

SessionFactory sessionFactory = HibernateUtil.getSessionFactory();
Session session = sessionFactory.openSession();
Query query = session.createSQLQuery(SQL_QUERY);

Configuration Details:
************************
I am using Hibernate3.0 with MYSql Database.

<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
<property name="dialect">org.hibernate.dialect.MySQLMyISAMDialect</property>

Exception Got:
*****************
SQLException.(SQLGrammerException)

Note:
******
I am able to run this query successfully when i dont use Aggregate function.

Pls Help me regarding this dialect problem.

Thanks in Advance,
sundar.


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

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.