-->
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.  [ 3 posts ] 
Author Message
 Post subject: parameters not passed correctly to query in xml file
PostPosted: Tue Apr 20, 2010 8:21 am 
Newbie

Joined: Tue Apr 20, 2010 4:25 am
Posts: 3
hi all,
I am facin issue with passing parameter to query in xml file.

This is how i am calling the named query from DAO.
Query query = getSession().getNamedQuery("Anamed query");
query.setString("Id",id);
query.setString("dt",date);

The query is not executed as both the parameters are passed null.
But when i hardcode the parameters in query.setString the query works fine.

Note: i able to sucessfully print the values just before the call to named query is made.

Any help in this regard will be highly appreciated.

Thanks


Top
 Profile  
 
 Post subject: Re: parameters not passed correctly to query in xml file
PostPosted: Wed Apr 21, 2010 9:32 am 
Newbie

Joined: Tue Apr 20, 2010 4:25 am
Posts: 3
nyyyyyyyyy sugeestions .............


Top
 Profile  
 
 Post subject: Re: parameters not passed correctly to query in xml file
PostPosted: Sat Apr 24, 2010 8:30 am 
Newbie

Joined: Tue Apr 20, 2010 4:25 am
Posts: 3
i am able run the query successfully if i generate second parameter(date) dynamically using query.

But i will still like run the query by passing two paramteres.
May be i am missing some settings.


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