Solved

Passing resultset object as a parameter to oracle procedure/function

Posted on 2002-06-02
8
609 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 92

Accepted Solution

by:
objects earned 100 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
servlet example 11 49
jboss wildfly 10.1 10 228
How to configure empty element in XML Document parser? 15 36
Eclipse Help Java EE 5,6,7 Documentation, why not Java EE 8 8 30
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

840 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