File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

callable statement

 
ALaxmi Shankaran
Greenhorn
Posts: 26
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In callable statements what exactly registerOutParameter does?
e.g storedProc.registerOutParameter(1, java.sql.Types.VARCHAR);
 
Gagan Gulati
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Martin Lira
Ranch Hand
Posts: 97
  • 0
  • Mark post as helpful
  • send pies
  • 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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic