• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stored proceduresand sql-server

 
suzi lu
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a stored proc which takes 5 parameters , does some manipulation and returns me a record set.How do i call that in JDBC?
callablestatement c = stmt.preparecall("call sp_myproc(?,?,?,?,?)")
and say setXXX for all the five parameters....and say
resultset rs = c.execute()
and then manipulate the resultset???
Am i correct???
Pl help...
Tx,
Suzi
 
John Bateman
Ranch Hand
Posts: 320
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey
My only comment to you would be.. what happens when you actually do that?
Let us know IF it doesn't work.

 
suzi lu
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I mean if I have a stored proc returning a resultset, taking in 5 parameters, then do i have to say, c.registeroutparameter for resultset???(i would say setXXX() for input params anyways)
Pl help me
Tx,
Suzi
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
then do i have to say, c.registeroutparameter for resultset???
That's only used if your parameters are defined as out or inout parameters. Your original post had all the required steps.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic