[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Passing resultset object as a parameter to oracle procedure/function

Posted on 2002-06-02
8
Medium Priority
?
632 Views
Last Modified: 2012-06-27
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 ?!!!


0
Comment
Question by:srinusimhadri
  • 5
  • 2
8 Comments
 
LVL 92

Expert Comment

by:objects
ID: 7050285
No.
0
 

Author Comment

by:srinusimhadri
ID: 7050292
jdbc, not yet sophisticated ?!!!
or is it oracle ?!!!
0
 
LVL 7

Expert Comment

by:tomboshell
ID: 7050495
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 92

Accepted Solution

by:
objects earned 400 total points
ID: 7050582
ResultSet != REF CURSOR
:-)
0
 

Author Comment

by:srinusimhadri
ID: 7052735
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
 

Author Comment

by:srinusimhadri
ID: 7052742
and we have features like casting, coercing or converting or whatever to facilitate data interchange.
0
 

Author Comment

by:srinusimhadri
ID: 7052824
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
 

Author Comment

by:srinusimhadri
ID: 8443186
I hope this answer is still valid (even for the new versions).


:-}
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses
Course of the Month20 days, 1 hour left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question