Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Object Relational Mapping and the fly likes  how to call a stored procedure which do not return a resultSet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark " how to call a stored procedure which do not return a resultSet" Watch " how to call a stored procedure which do not return a resultSet" New topic
Author

how to call a stored procedure which do not return a resultSet

peter tong
Ranch Hand

Joined: Mar 15, 2008
Posts: 240
is it possible to call a sql server 2005 stored procedure which does not return a resultset? (the stored procedure is just a update statement, not a select statement, so not resultset is return!!)
is there any example?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

I am guessing this is a Hibernate question?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
peter tong
Ranch Hand

Joined: Mar 15, 2008
Posts: 240
in hibernate document, 16.2.2.1. Rules/limitations for using stored procedures, there is a statement
[quoted]
For Sybase or MS SQL server the following rules apply:
The procedure must return a result set.
[/quoted]
but my stored procedure does not return anything, so is it possible to overcome the limitation and call it in hibernate?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

So it is a Hibernate question. YOu could just call the procedure via native SQL; there is method on the Session class to do just that.
peter tong
Ranch Hand

Joined: Mar 15, 2008
Posts: 240
how to do it? use something likes CallableStatement?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to call a stored procedure which do not return a resultSet
 
Similar Threads
How to create Oracle stored procedure and return ResultSet as OUT param...?
How resultset is returned by stored procedure?
getting ResultSet from Java Stored Procedure
Regarding reultset in stored procedures
How to return a table from MS SQL servers Stored Procd. to Java