-->
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: problem with calling stored procedures
PostPosted: Wed Apr 19, 2006 3:34 am 
Newbie

Joined: Wed Apr 19, 2006 3:23 am
Posts: 3
Hi.

I'm experiencing the following problem when trying to retrieve some data as a result of calling an Oracle function through hibernate.

This is my mapping xml:
<sql-query name="ConnectToGUI_SP" callable="true">
<return alias="GlobalData" class="fr.interfacesi.gpm.template.model.GlobalData">
<return-property name="profiles" column="PROFILES"/>
<return-property name="defProfileId" column="DEFPROFILEID"/>
<return-property name="defaultRtf" column="DEFAULTRTF"/>
<return-property name="displayName" column="DISPLAYNAME"/>
<return-property name="sessionId" column="SESSIONID"/>
</return>
{? = call CONNECTTOGUI(?,?)}
</sql-query>

and my java code:
org.hibernate.Query hibQuery = null;
hibQuery = session.getNamedQuery("ConnectToGUI_SP");
hibQuery.setReadOnly(true);
hibQuery.setString(0,(String)s);
hibQuery.setString(1,(String)s);
List l = hibQuery.list();



And I keep getting this exception when running the code through a junit test case:

Hibernate: {? = call CONNECTTOGUI(?,?)}
2006-04-19 10:12:26,785 WARN [org.hibernate.util.JDBCExceptionReporter] - SQL Error: 6550, SQLState: 65000
2006-04-19 10:12:26,785 ERROR [org.hibernate.util.JDBCExceptionReporter] - ORA-06550: line 1, column 13:
PLS-00382: expression is of wrong type
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored


So can anyone help with a suggestion, please?
Thanks a lot.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 20, 2006 1:26 am 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Probably the show_sql output would help too, but one thing you'll have to fix is the parameter numbering. There are three parameters in your SQL: the return, and the two IN parameters. But you're setting your two IN values (s and s) to parameters 0 and 1: the return parameter and the first IN parameters. Change your setString() calls to use indices 1 and 2.


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.