• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

callable statement

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In callable statements what exactly registerOutParameter does?
e.g storedProc.registerOutParameter(1, java.sql.Types.VARCHAR);
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As you are using callable statements over a Stored proc. That stored proc might return some parameters.
To get these parameters in your Java variables, you have to first register these parameters.

-G
 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might need to register a parameter when your stored procedure (stp)returns you some values.
Example: There is a stp called GetNoOfRegisteredUsers{1,2,3}

1 and 2 = IN Parameter like user id and dob
3 = OUT parameter of type java.sql.INTEGER

So you will have to write it like this



Note: If your stored procedure returns a ResultSet it should be read first before doing a stmt.getInt(3). As doing this implicitly closes the ResultSet.

Martin

[ August 19, 2004: Message edited by: Martin Lira ]

[ August 19, 2004: Message edited by: Martin Lira ]
[ August 19, 2004: Message edited by: Martin Lira ]
 
Cob is sand, clay and sometimes straw. This tiny ad is made of cob:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic