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

Home -> Community -> Usenet -> c.d.o.server -> Re: Newbie odbc/oracle-procedure-questions

Re: Newbie odbc/oracle-procedure-questions

From: <jernigam_at_kochind.com>
Date: 18 Feb 2005 06:51:58 -0800
Message-ID: <1108738318.580729.233440@o13g2000cwo.googlegroups.com>


We use a procedure that takes the stored procedure call as a parameter, and then an array of objects for the parameters. It looks something like this.

public ResultSet executeCall(String sCall, Object[] params) throws SQLException

    {

        int iParamOffset = 2;
        CallableStatement call = conn.prepareCall(sCall);
        call.registerOutParameter(1, OracleTypes.CURSOR);
        for (int i = 0;i<params.length;i++)
        {
            call = updateCallParam(call, i+iParamOffset, params[i]);
        }
        call.execute();
        ResultSet rset = (ResultSet)call.getObject(1);
        call.close();
        return rset;

    } Received on Fri Feb 18 2005 - 08:51:58 CST

Original text of this message

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