-->
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: Call procedure from Hibernate and get ArrayStoreException.
PostPosted: Fri May 28, 2010 8:36 am 
Beginner
Beginner

Joined: Tue Aug 26, 2008 4:24 pm
Posts: 29
Hy, I have problem calling a procedure in Oracle. My procedure is like the next:

PROCEDURE CloseEpisode(P_CURSOR out sys_refcursor,P_EPIS_ID IN INTEGER)
AS
BEGIN
DELETE FROM sene1_visitas WHERE sene1_visitas.VISI_EPIS_ID = P_EPIS_ID;
OPEN P_CURSOR FOR SELECT EPIS_ID, EPIS_EPISODIO
FROM sene1_episodios where sene3_episodios_ant.EPIS_ID= P_EPIS_ID;
END;

I have the next doubts:

1. I am using the cursor because I am calling this procedure from Hibernate and the documentation says that you have to return a resulset. I cant return anything because its a procedure, right? So the cursor I am using is ok, right?
2. So the format call for the prodecure I am using {?=call closeEpisodio(?,?)}, is it right?
3. In my java code I have done the next things:
- if I setInt(2, Integer of EpisId) I get : IllegalArgumentException Positional parameter does not exist: 2 in query: {?=call cerrarEpisodio(?,?)}. .
-if I setInt(1, Integer of EpisId) I get the error java.lang.ArrayStoreException.
4. Do I have to set other parameters?

What is wrong?

Thanks


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.