-->
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: QUERYEXCEPTION:Expected positional parameter count: 1,...
PostPosted: Fri Oct 10, 2008 4:24 am 
Newbie

Joined: Fri Oct 10, 2008 4:12 am
Posts: 2
Hi all,
am new ti hibernate. When i try to call stored procedure from java file i got an exception
the following is the calling stored procedure in hbm.xml file...

session = HibernateSession.getSession();
t = session.beginTransaction();
Query query = session.getNamedQuery("userselect_sp");
List list = query.list();
System.out.println(list.size());

in hbm.xml file
<sql-query name="userselect_sp">
{? = call sp_select_pro()}
</sql-query>

am getting an error
org.hibernate.QueryException: Expected positional parameter count: 1, actual parameters: [] [{? = call sp_select_pro()}]
at org.hibernate.impl.AbstractQueryImpl.verifyParameters(AbstractQueryImpl.java:118)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:133)
at com.hiber.first.QueryChecking.main(QueryChecking.java:27)
Exception in thread "main" org.hibernate.QueryException: Expected positional parameter count: 1, actual parameters: [] [
{? = call sp_select_pro()}
]
at org.hibernate.impl.AbstractQueryImpl.verifyParameters(AbstractQueryImpl.java:118)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:133)
at com.hiber.first.QueryChecking.main(QueryChecking.java:27)

help to sort out this problem...
thanks in advance...

regards
parthiban[/quote][/code]


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.