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

  • Home
  • SEARCH
  • 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 6093153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:31:40+00:00 2026-05-23T12:31:40+00:00

I am using Java + iBatis and have a need to call an Oracle

  • 0

I am using Java + iBatis and have a need to call an Oracle Stored Procedure that takes a cursor as an argument. Google didn’t help me much in finding a code sample of how to call a stored procedure that accepts a cursor as an argument from java.

How can this be accomplished?

Scenario in steps:

 1. Java calls a Stored Proc passing primitives (varchar, char, etc) as
    parameters 
 2. Java retrieves the cursor returned from Step 1 
 3. Java calls a Stored Proc passing cursor from Step 2 as an argument  //how? 
  • 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-05-23T12:31:40+00:00Added an answer on May 23, 2026 at 12:31 pm

    If those are really the only steps — i.e. you aren’t doing anything of importance in Java between the two calls — then it makes more sense to me to avoid returning to Java at all.

    If the first procedure were actually a function, you could simply do a single nested call:

    BEGIN proc2(proc1(...)); END;
    

    The cursor gets passed within Oracle and never needs to be handled by Java at all.

    If your first procedure is a procedure that returns the cursor as an OUT parameter, you could write a wrapper function for it and do the same thing:

    CREATE OR REPLACE FUNCTION func1(...)
      RETURN SYS_REFCURSOR
      AS
        foo SYS_REFCURSOR;
      BEGIN
        proc1(..., foo);
        RETURN foo;
      END func1;
    /
    

    Then BEGIN proc2(func1(...)); END; should work.

    Now, if you really do need to go out to Java between the two calls, then I would try using OracleTypes.CURSOR when retrieving the output value from the first procedure, then simply pass that object into the second procedure. I don’t know if this will work; if not, then there’s probably no direct way to do it.

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

Sidebar

Related Questions

I'm using Java and Ibatis to call a stored procedure on on oracle database.
I'm currently wrestling with an Oracle SQL DATE conversion problem using iBATIS from Java.
I need a some stored procedure that called like: search('foo bar') makes a search
Using Java 1.4.2 with unlimited jurisdiction policy files installed. I have a class that
I have written a PLSQL stored procedure , i want to call the procedure
There is a way to specify IBatis query timeout using oracle jdbc and Java?
Using Java 6: I have a method that uses a Thread to run a
Using Java, how can I test that a URL is contactable, and returns a
Using Java (1.6) I want to split an input string that has components of
I'm using Java, and need to generate a simple, standards-compliant RSS feed. How can

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.