Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7808677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:12:07+00:00 2026-06-02T03:12:07+00:00

I’m running a java method to call a stored procedure in an Oracle 11.2

  • 0

I’m running a java method to call a stored procedure in an Oracle 11.2 database. I’m using JDBC connection calling the stored procedure with an OUT parameter to return a database cursor as a result set back to the java method. Everything is working fine.

Now I want to return a second result set to the java method in the SAME stored procedure. If I just add a second OUT parameter to this stored procedure and open a second cursor, everything also seems to work fine.

I’m wondering if this is the proper thing to do, because both cursors are simply opened in the stored procedure, relying on the java method to close them.

Will either cursor or result set have problems resulting from the fact that the first cursor is OPENed, after which some stuff is selected, and then the second cursor is OPENed with different stuff selected? Will the second stuff selected screw up the first stuff selected, or vice versa? Or is the database smart enough to know when the second cursor is opened, any new selections are directed to it and not the first cursor open?

I’m new to all this and just wanted to check this is how it’s intended to return multiple cursors into corresponding result sets in java. Thanks for any comments.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T03:12:08+00:00Added an answer on June 2, 2026 at 3:12 am

    Both cursors are completely different entities that point to completely different queries that return results as of a completely different SCN. So there is no risk of confusion from the database. Your Java code will get separate ResultSet objects that need to be fetched from separately so your code needs to make sure that it’s fetching from the right ResultSet— if there is any confusion, it’s much more likely to be a bug in your code where you’re fetching from the wrong cursor or failing to close both cursors in all cases.

    While it is technically quite possible to return multiple cursors from a stored procedure, I would tend to suspect that there is a better solution. Most of the time, if there are multiple related cursors, that implies that the calling code is manually coding some sort of join operation. If that’s the case, you’d be much better served letting Oracle do the join and returning a single REf CURSOR.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have thousands of HTML files to process using Groovy/Java and I need to
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I am currently running into a problem where an element is coming back from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.