Passing resultset object as a parameter to oracle procedure/function

1. I will have a resultset object in java program with certain rows
2. I will have a oracle procedure/function with one of the parameter defined as REF CURSOR, which I will be looping through inside the program to process
3. and I will call the oracle procedure through JDBC, using resultset object as one of the parameter to be sent to the oracle procedure/function.


Is this possible ?!!!


srinusimhadriAsked:
Who is Participating?
 
objectsConnect With a Mentor Commented:
ResultSet != REF CURSOR
:-)
0
 
objectsCommented:
No.
0
 
srinusimhadriAuthor Commented:
jdbc, not yet sophisticated ?!!!
or is it oracle ?!!!
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
tomboshellCommented:
Here is something to keep in mind when working with the ResultSet,  "A ResultSet object is automatically closed when the Statement object that generated it is closed, re-executed, or used to retrieve the next result from a sequence of multiple results. "  (from the JavaDocs)

Therefore, if you will be working with what would basicall be a controlling ResultSet you will have problems.  The data will dissappear.  But, luckily there are collections.  Use a collection like a Vector.  Since it is a table structure use a vector of vectors (similar to the JTable constructor).  The outer vector holds many inner vectors, which can contain the String, Integer, Boolean values (or whatever you are using, but make sure it is the wrapper class when working with the primitives.)  It is the collection that you will want to use to control the program, and the result set to verify and to obtain the data.  

Tom
0
 
srinusimhadriAuthor Commented:
WELL,
technically NO,
but,
a variable declared to be a resultset, is capable of holding a set of rows (theoritically called a cursor).
AND
a variable declared to be REF CURSOR also is capable of bolding a set of rows.
0
 
srinusimhadriAuthor Commented:
and we have features like casting, coercing or converting or whatever to facilitate data interchange.
0
 
srinusimhadriAuthor Commented:
sorry, typo in my earlier message...
I said...
"a variable declared to be REF CURSOR also is capable of bolding a set of rows."

I meant to say "holding" not "bolding"
0
 
srinusimhadriAuthor Commented:
I hope this answer is still valid (even for the new versions).


:-}
0
All Courses

From novice to tech pro — start learning today.