Re: please help: problem in calling javastored procedure in Oracle8i

From: Finn Ellebaek Nielsen <fen_at_changegroup.dk>
Date: Sun, 28 Mar 1999 12:56:40 +0100
Message-ID: <7dl1sl$leb$1_at_news.inet.tele.dk>


jy1999_at_my-dejanews.com wrote in message <7cvfch$n37$1_at_nnrp1.dejanews.com>...
>I am a new Oracle user, right now using Oracle8i and java as develop tools.
I
>have two questions:
>
>(1)suppose in a java stored procedure, I have a ResultSet object holds a
set
>of records (ResultSet rs = mystatement.executeQuery("select * from emp"),
how
>can I pass this rs ResultSet object back to the stand alone calling program
>written in java.
>
>(2)when I call a java stored procedure, in the code below:
>...............
>CallableStatement stmt = conn.prepareCall("call stored_procedure(?, ?)");
>stmt.setString(1, firstParam);
>stmt.registerOutParameter(2, secondParam);
>stmt.execute();
>secondParam = stmt.getString(2);
>...............
>/* up to here I suppose can get the secondParam's value set by the stored
>procedure after calling it, but I got a NULL value. Why? But the firstparam
is
>successfully pass to the stored procedure. */
>
>Can anybody give me help? Ff you can attach some simple samples would be
>great!
>
>Thanks a lot!
>
>
>Jiang Yin
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

Instead of doing all these JDBC calls you could consider using SQLJ, the new ANSI standard for embedding SQL in Java. Oracle recently posted an article with SQLJ examples on http://technet.oracle.com.

Hope this helps.

Finn Received on Sun Mar 28 1999 - 13:56:40 CEST

Original text of this message