Hi, I need to handle the return set from COBOL stored procedure from my invoking Java program. I do not know, how many rows the stored proc SQL fetches.I have declared the cursor in that proc, but i don't know how to return the rows the cursor has opened and I don't know how to handle the return set from the proc in my java code.

My main problem with that proc is that whether I can retun the result set from the proc without closing the cursor in that proc or I have to fetch that rows to some host variables in that proc and move that to out parameter fields,then close the cursor in the proc.

Do I need to have the out parameter for returning the result sets from COBOL stored proc to invoking java prog,and If so, what will be the data type for that
out parameter.

Another doubt is that , do there is any parameter type like SYSREF CURSOR (which is in oracle stored procedures) in DB2.I am confused about handling the return sets in my java prog.

I am working in DB2 database, OS/390 environment.
Can anyone tell me how to handle the result set from cobol stored proc in my invoking java program with an simple example.