If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Return resultset from SP

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-11-09, 11:39
xerg xerg is offline
Registered User
 
Join Date: Aug 2009
Posts: 5
Return resultset from SP

Hi guys , i have a big problem with this requeriment,

I need create a stored procedure with the following structure

In parameters:
String cod
String date

Out Parameters:
String flag
String type

Resultset:
id | name | country

My problem is how can I capture out parameters and resultset from Java, is it possible doing that?????

pd:sorry for my english
Reply With Quote
  #2 (permalink)  
Old 08-11-09, 12:21
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Reply With Quote
  #3 (permalink)  
Old 08-11-09, 12:58
xerg xerg is offline
Registered User
 
Join Date: Aug 2009
Posts: 5
Thanks n_i!!

Code:
//Register out parameter
cstmt.registerOutParameter (1, Types.INTEGER);   

cstmt.executeUpdate(); 

//getting out parameter
ifcaret = cstmt.getInt(1);
But, if SP also return ResultSet, can I read it in same object "cstmt"??
Reply With Quote
  #4 (permalink)  
Old 08-11-09, 13:14
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by xerg

But, if SP also return ResultSet, can I read it in same object "cstmt"??
You certainly can, but only if you read the document I indicated earlier.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On