Re: Help! Getting a ResultSet from an Oracle Function not working

From: The Nomad <nobody_at_nowhere.com>
Date: Fri, 20 Apr 2001 19:52:46 GMT
Message-ID: <is0E6.50479$fs3.9354585_at_typhoon.tampabay.rr.com>


> Can the JDBC Drivers access PL/SQL Stored Procedures?
> Yes, both the Oracle JDBC/OCI Driver and the Thin JDBC Driver support
> execution of PL/SQL stored procedures and anonymous blocks. and anonymous
> blocks. They support both SQL92 escape syntax and Oracle escape syntax.
 The
> following PL/SQL calls are available from both of Oracle JDBC Drivers:
> SQL92 Syntax
> CallableStatement cs1 = conn.prepareCall ("{call proc (?,?)}");
> CallableStatement cs2 = conn.prepareCall ("{? = call func (?,?)}");
>
> Oracle Syntax
> CallableStatement cs1 = conn.prepareCall ("begin proc (:1,:2); end;");
> CallableStatement cs2 = conn.prepareCall ("begin :1 := func (:2,:3);
end;");

I guess you didn't read further down. The question wasn't "can it call stored procedures". The question/statement was "Getting a ResultSet from an Oracle Function". The fact remains that for Oracle, you have to import Oracle-specific classes and use Oracle-specific functions to get a resultset from a Stored Function. In all the other RDBMS', the stored procedure can simply return a resultset. Oracle in this case is inferior to other RDBMS' in it's support for JDBC.

I should be able to write generalized JDBC code to get a resultset from a stored proc/function. I can't because Oracle returns REFCURSORS instead of resultsets. So, I have to subclass my repository objects and create OracleRepository objects that know how to call Oracle and get out resultsets.

Unbelievable! Received on Fri Apr 20 2001 - 21:52:46 CEST

Original text of this message