-->
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: Do an query avec 2 inconnu ?
PostPosted: Wed Nov 23, 2005 11:57 am 
Beginner
Beginner

Joined: Thu Aug 11, 2005 11:16 am
Posts: 20
hi,

i need help to do an query like that :

Query q = HibernateUtil.getSession().createQuery("FROM AC_param param WHERE param.param_name = ? AND param.ac_id = ?");

q.setText(0, param_name , ac_id );

How i can replace first ? by param_name and the second ? by ac_id ?

_________________
Cyril,


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 07, 2005 10:10 pm 
Newbie

Joined: Fri Dec 02, 2005 11:33 am
Posts: 10
Location: Québec, Canada
Hello,

You need to do something like this:
q.setText(0, param_name);
q.setText(1, ac_id);

or

q.setString(0, param_name);
q.setString(1,ac_id);

_________________
François J.
Don't forget to rate


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.