-->
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.  [ 4 posts ] 
Author Message
 Post subject: a call of stored procedure
PostPosted: Mon Jan 05, 2004 10:46 am 
Beginner
Beginner

Joined: Thu Dec 11, 2003 9:54 am
Posts: 25
Hi guys,

Is there a way in Hibernate to call a stored procedure/function, with some kind of lightweight-method ?

-awt


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 05, 2004 1:04 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Get the JDBC connection by calling session.connection() and call your stored procedure like you allways do with SQL.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 05, 2004 2:06 pm 
Beginner
Beginner

Joined: Thu Dec 11, 2003 9:54 am
Posts: 25
OK, got it worked.

Seems that there are some thoubles with calling Oracle9i stored procedure, which will return a CURSOR.

Is there a other way of workaround ? Here is a piece of my code:

Code:
    CallableStatement cstmt = connection.prepareCall(
        "{call FIRSTPKG.second_procedure(?, ?)}");
    cstmt.setString(1, "here");
    cstmt.registerOutParameter(2, OracleTypes.CURSOR);
    cstmt.execute();



gloeglm wrote:
Get the JDBC connection by calling session.connection() and call your stored procedure like you allways do with SQL.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 05, 2004 4:05 pm 
Beginner
Beginner

Joined: Thu Dec 11, 2003 9:54 am
Posts: 25
OK, Got this as well.
10x


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