You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Timlin, Bob" <Ti...@sutterhealth.org> on 2001/12/21 20:07:51 UTC

Returning a Resultset from an Oracle Stored Procedure

Can anyone give me a reference to where I can get some detail information on
returning a resultset from an Oracle Stored Procedure to a JSP program?  I
have found many samples of how to do this on the JSP side, but no
information on how to write a Oracle Stored Procedure that returns a
Resultset.

Thanks!

Bob Timlin
Senior Software Engineer
C.P.M.C Information Technology
415-600-7005
TimlinB@Sutterhealth.org



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Returning a Resultset from an Oracle Stored Procedure

Posted by Robert Dunlop <rd...@value.net>.
> Can anyone give me a reference to where I can get some detail information
on
> returning a resultset from an Oracle Stored Procedure to a JSP program?  I
> have found many samples of how to do this on the JSP side, but no
> information on how to write a Oracle Stored Procedure that returns a
> Resultset.



Bob,

    You need to go to your Oracle documentation on this.  And, depending on
the version of Oracle this may be a problem.  I don't think Oracle in
versions prior to 8x supported returning result sets from stored procs.  I
know I've found some ugly work arounds when trying to do the same from C++
apps via ODBC.

Bob




--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


RE: Returning a Resultset from an Oracle Stored Procedure

Posted by John Schroeder <js...@quovera.com>.
The stored procedure (or function) needs to return a REF_CURSOR.

Here's an example (very contrived) of the Java code:

Connection conn = getConnection(); // get connection from somewhere ( a pool
maybe ).
Callable statement = conn.prepareCall("{? = call someProc }");
statement.registerOutParameter(1);
statement.execute();
ResultSet rs = statement.getObject(1,OracleTypes.CURSOR);



Hope this helps!

--John




-----Original Message-----
From: Timlin, Bob [mailto:TimlinB@sutterhealth.org]
Sent: Friday, December 21, 2001 11:08 AM
To: 'tomcat-user@jakarta.apache.org'
Subject: Returning a Resultset from an Oracle Stored Procedure


Can anyone give me a reference to where I can get some detail information on
returning a resultset from an Oracle Stored Procedure to a JSP program?  I
have found many samples of how to do this on the JSP side, but no
information on how to write a Oracle Stored Procedure that returns a
Resultset.

Thanks!

Bob Timlin
Senior Software Engineer
C.P.M.C Information Technology
415-600-7005
TimlinB@Sutterhealth.org



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


VS: Returning a Resultset from an Oracle Stored Procedure

Posted by Teemu Keiski <wr...@mbnet.fi>.
You can do it using Oracle's REF cursor in packages(if you have Oracle 8i or
newer). Idea is to create package, define ref cursor and define the
procedure to use that ref cursor (in the package). Then you call
package.procedurename(parameters) with JDBC and so on.

The best documentation you can found is at Oracle web site(or with your
Oracle installation(Oracle8i JDBC Developer's Guide and Reference)). But you
have to register yourself to the Oracle's Technology network to be able to
view the docs online at Oracle.

Here is link to the Oracle8i JDBC Developer's Guide and Reference at
Oracle's site:
http://otn.oracle.com/doc/java.815/a64685/toc.htm

Teemu Keiski
Application analyst, programmer
Mansoft tietotekniikka Oy
Finland

-----Alkuperainen viesti-----
Lahettaja: Timlin, Bob [mailto:TimlinB@sutterhealth.org]
Lahetetty: 21. joulukuuta 2001 21:08
Vastaanottaja: 'tomcat-user@jakarta.apache.org'
Aihe: Returning a Resultset from an Oracle Stored Procedure


Can anyone give me a reference to where I can get some detail information on
returning a resultset from an Oracle Stored Procedure to a JSP program?  I
have found many samples of how to do this on the JSP side, but no
information on how to write a Oracle Stored Procedure that returns a
Resultset.

Thanks!

Bob Timlin
Senior Software Engineer
C.P.M.C Information Technology
415-600-7005
TimlinB@Sutterhealth.org



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>