dbTalk Databases Forums  

Create ResultSet "from scratch" in Oracle Java Stored Procedure?

comp.databases.oracle comp.databases.oracle


Discuss Create ResultSet "from scratch" in Oracle Java Stored Procedure? in the comp.databases.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jim Garrison
 
Posts: n/a

Default Create ResultSet "from scratch" in Oracle Java Stored Procedure? - 09-01-2004 , 12:10 PM






I need to create a ResultSet in an Oracle Java Stored Procedure and
return it to a PL/SQL caller. I've done quite a bit of research in
Oracle's manuals and on the Web, and have found lots of references to
going the other direction (PL/SQL passing/returning REF CURSOR to
Java), and Java returning an existing ResultSet (obtained from the
databse) as a REF CURSOR to PL/SQL. Neither of these is what I'm
looking for.

My Java stored procedure will do significant data reduction on a large
database, and then needs to return a large result set to the caller,
which will be in PL/SQL. To the PL/SQL caller, the Java stored
procedure needs to look like a "table function", but I need to create
the result set from scratch in my Java code. What I think I need is a
documented skeleton ResultSet implementation that I can extend.

Anyone know if this is available anywhere, or have pointers to
documentation?

Jim Garrison
jhg (AT) athensgroup (DOT) com

Reply With Quote
  #2  
Old   
Jim Kennedy
 
Posts: n/a

Default Re: Create ResultSet "from scratch" in Oracle Java Stored Procedure? - 09-01-2004 , 09:30 PM







"Jim Garrison" <jhg (AT) athensgroup (DOT) com> wrote

Quote:
I need to create a ResultSet in an Oracle Java Stored Procedure and
return it to a PL/SQL caller. I've done quite a bit of research in
Oracle's manuals and on the Web, and have found lots of references to
going the other direction (PL/SQL passing/returning REF CURSOR to
Java), and Java returning an existing ResultSet (obtained from the
databse) as a REF CURSOR to PL/SQL. Neither of these is what I'm
looking for.

My Java stored procedure will do significant data reduction on a large
database, and then needs to return a large result set to the caller,
which will be in PL/SQL. To the PL/SQL caller, the Java stored
procedure needs to look like a "table function", but I need to create
the result set from scratch in my Java code. What I think I need is a
documented skeleton ResultSet implementation that I can extend.

Anyone know if this is available anywhere, or have pointers to
documentation?

Jim Garrison
jhg (AT) athensgroup (DOT) com
Did you look at the pipelined property of a function?
Jim




Reply With Quote
  #3  
Old   
Pratap
 
Posts: n/a

Default Re: Create ResultSet "from scratch" in Oracle Java Stored Procedure? - 09-01-2004 , 11:28 PM



I assume that your Java procedure is working on some huge data in the
database, and then generating a set of rows that you want to pass on
to PL/SQL.
From Java you can batch insert the data in a temporary table. PL/SQL
can then read this table. The insert overhead in the temporary table
will be very less.

If you are using Oracle 9i you may use pipelined functions can also be
used as they they can be written in Java. But I don't know much about
Java.

Pratap

Reply With Quote
  #4  
Old   
Jim Garrison
 
Posts: n/a

Default Re: Create ResultSet "from scratch" in Oracle Java Stored Procedure? - 09-02-2004 , 02:10 PM



Pratap wrote:
Quote:
I assume that your Java procedure is working on some huge data in the
database, and then generating a set of rows that you want to pass on
to PL/SQL.
From Java you can batch insert the data in a temporary table. PL/SQL
can then read this table. The insert overhead in the temporary table
will be very less.

If you are using Oracle 9i you may use pipelined functions can also be
used as they they can be written in Java. But I don't know much about
Java.

Pratap
Sounds like what I need, except I can't find in Oracle's
documentation the Java equivalent of the PL/SQL "PIPE ROW"
statement. You say pipelined functions can be written in Java...
do you have any pointers to documentation?

Thanks

Jim Garrison
jhg (AT) athensgroup (DOT) com


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.