Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
peter tong
Ranch Hand
Posts: 246
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am guessing this is a Hibernate question?
 
peter tong
Ranch Hand
Posts: 246
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 246
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to do it? use something likes CallableStatement?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic