Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Oracle Stored Procedure returns ResultSet

Oracle Stored Procedure returns ResultSet

From: <pax_prakarsa_at_my-dejanews.com>
Date: Fri, 31 Jul 1998 18:39:57 GMT
Message-ID: <6pt31t$5ev$1@nnrp1.dejanews.com>


I need to write an Oracle stored procedure that executes a query and returns a java.sql.ResultSet object. Could anyone give me an example of such a stored procedure.

The java code that I am going to use to get the java.sql.ResultSet object is the following:

Note: callstmt is a CallableStatement which should be defined according to the signature/parameter definition of the stored procedure.

// EXECUTE CALLABLE STATEMENT SQL
boolean ret = false;
ResultSet results = null;
int updateCount = 0;
try {

    ret = callstmt.execute();
    if (ret == true){

        results = callstmt.getResultSet();
}

    else{

        updateCount = callstmt.getUpdateCount();
}

    return ret;
} catch(Exception e){

    System.out.println(e);
}

Thanks
Pax

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Fri Jul 31 1998 - 13:39:57 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US