-->
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.  [ 5 posts ] 
Author Message
 Post subject: query.executeUpdate() cannot resolve symbol
PostPosted: Wed Nov 14, 2007 2:48 am 
Newbie

Joined: Tue Oct 23, 2007 6:29 am
Posts: 4
hi


Session session=null;
SessionFactory sessionFactory =
new Configuration().configure).buildSessionFactory();
session =sessionFactory.openSession();
Transaction tx = session.beginTransaction();

sql="update templateBean set template=:template where userid=:user and templateid=:templateid ";

Query query = session.createQuery(sql);
query.setString("template", tbean.getTemplate().trim());
query.setString("user", tbean.getUserid().trim());
query.setLong("templateid", tbean.getTemplateid());
update = query.executeUpdate();
tx.commit();
session.close();

in this its telling a compile time error even after importing
import org.hibernate.Query Interface
update = query.executeUpdate();

plz assist me
selva


Top
 Profile  
 
 Post subject: Hii Revati
PostPosted: Wed Nov 14, 2007 2:55 am 
Newbie

Joined: Tue Nov 13, 2007 7:25 am
Posts: 8
Location: Bhubaneswar
update = query.executeUpdate();

The return type is of int type. So have you declared update as int ???

if so then do it & post reply. If it doesn't solve yr problem then try to paste yr complete class including import statements in this forum.....

_________________
Regards
Lalit Narayan Mishra


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 14, 2007 11:35 am 
Newbie

Joined: Tue Oct 23, 2007 6:29 am
Posts: 4
hi lalit,

thanx 4 u reply.
yes i declared as int.
i will post my full code soon

thanx a lot.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 14, 2007 1:02 pm 
Expert
Expert

Joined: Fri Jul 13, 2007 8:18 am
Posts: 370
Location: london
What error?

You've got a dodgy bracket here:
Code:
new Configuration().configure).buildSessionFactory();
session =sessionFactory.openSession();


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 16, 2007 2:22 pm 
Newbie

Joined: Tue Oct 23, 2007 6:29 am
Posts: 4
thanx a lot lalit .let me check n say

thanx
selva


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.