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 7056521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:52:37+00:00 2026-05-28T03:52:37+00:00

I have two procedures: a java stored procedure JAVA_P() which is linked to a

  • 0

I have two procedures: a java stored procedure JAVA_P() which is linked to a static method O.execute() and a pl/sql procedure SQL_P(in_param IN CUSTOM_TYPE_1, out_param OUT CUSTOM_TYPE_2).

JAVA_P calls SQL_P with CallableStatement.

And now a big WTF:
When I run O.execute() outside oracle (from external jvm) received out_param is set as expected.
When I run O.execute() as JAVA_P() (using oracle built-in jvm) then out_param is set to null (SQL_P is executed without exception and output parameter should be set).

Do you have any ideas why this happens?

Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 – 64bi
JRE version used for tests 1.4.2_04.
JDBC version 10.2.0.3.0

@Juergen Hartelt my english may not be good enought to explain this clearly but i will try this way:

1) i have write some java code using as usual my IDE:

public class P141_JAVABridge
{
   public static void execute()
   {
        String databaseDriver = "oracle.jdbc.driver.OracleDriver";
        String databaseUrl = "jdbc:oracle:thin:@xxx:1521:orcl";
        String databaseUsername = "xxx";
        String databasePassword = "xxx";

        ods.setDriverType(databaseDriver);
        ods.setURL(databaseUrl);
        ods.setUser(databaseUsername);
        ods.setPassword(databasePassword);

        connection = ods.getConnection();


        .... some code

        map.put("custom_T",Custom_T_SQLData.class);

        CallableStatement call = connection.prepareCall("call P141(?,?)");

        call.setObject(1,inputObjectReference);
        call.registerOutParameter(2,OracleTypes.STRUCT,"custom_T");
        call.execute();

        .... some code

   }
}

2) i run this code – wooha! it works

3) i have changed

connection = ods.getConnection();

to

connection = DriverManager.getConnection("jdbc:default:connection:");

4) compile and load class into oracle

5) i have linked P141_JAVABridge.execute() with P141_JB

create or replace PROCEDURE P141_JB () IS LANGUAGE JAVA NAME 'x.y.z.P141_JAVABridge.execute()';

6) then i executed P141_JB

SET SERVEROUTPUT ON;
BEGIN

   ...some code

   P141_JB();

   ...some code

END;

and got NullPointerException at

((Custom_T_SQLData)call.getObject(2)).responseStatus
  • 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-28T03:52:38+00:00Added an answer on May 28, 2026 at 3:52 am

    I have done as Tolls adviced me and I have put “call P141(?,?)” into braces:

    "{call P141(?,?)}"
    

    TADA! It works.

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

Sidebar

Related Questions

I have two stored procedures I wish to use in my stored procedure, but
I have two PL/SQL Stored procedure each handling its own Transaction (Begin/Commit and Rollback
We have two stored procedures in Microsoft SQL Server that return data that is
I have two stored procedures, one of which returns a list of payments, while
Workflow: I have two stored procedures. One stored procedure calls the other. When I
I have two stored procedures that I want execute wrapped in a transaction. For
I have two sql files: The first one creates database, tables, and stored procedures.
I have a stored procedure that returns two int Values. The first can not
I have a stored procedure that takes no parameters, and it returns two fields.
I am developing a PL/SQL stored procedure which inserts rows into a table. The

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.