• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 210
  • Last Modified:

retrieving multiple rows from java stored procedures

i have  written a select query which returns multiple  records . And iam writing this
inside the BODY  of a  stored procedure.  iam retrieving two columns from the table.
iam storing these columns in  two varrays  , which are out parameters in my stored procedure,  how to  retirieve the  varrays  from  my  JDBC program. Please give
the code.

sarath
0
sdushyanth
Asked:
sdushyanth
1 Solution
 
CEHJCommented:
See
http://javaalmanac.com/egs/java.sql/CallProcedure.html

In your case, try:


ResultSet array1 = (ResultSet)cs.getObject(1);    
ResultSet array2 = (ResultSet)cs.getObject(2);    

If that doesn't work, cast it to whatever *is* being returned by the driver in getObject and use that
0
 
objectsCommented:
Array a = cs.getArray(1);
Array b = cs.getArray(2);

or for Oracles specific use:

ARRAY a = ocs.getARRAY(1);
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now