retrieving multiple rows from java stored procedures

Posted on 2004-11-04
Last Modified: 2010-03-31
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.

Question by:sdushyanth
    LVL 1

    Expert Comment

    LVL 86

    Expert Comment


    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
    LVL 92

    Accepted Solution

    Array a = cs.getArray(1);
    Array b = cs.getArray(2);

    or for Oracles specific use:

    ARRAY a = ocs.getARRAY(1);

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Suggested Solutions

    This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
    This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now