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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:12:00+00:00 2026-06-13T02:12:00+00:00

I am working on a Java based project, where things are implemented in the

  • 0

I am working on a Java based project, where things are implemented in the following way

  • There are some classes (A,B,C,D….) which takes Hash Map having key as an Integer and value as an array list of String. Every String element in the arraylist is a Oracle SQL Query (INSERT or UPDATE)
  • These methods of classes (A,B,C,D….) loops through the Map. All the SQL Queries of a particular key are added to a batch using JDBC Statement (**stmt.addBatch(String)**). For every unique key, there is a separate batch created and executed.
  • There are many classes (X,Y,Z…) which are working on populating this Map and arraylist of Strings to put different INSERT and UPDATE Queries

Now, I need to add an Oracle procedure call for some keys and hence should be added to the String Arraylist for the respective keys.

I tried adding the following strings to call procedures, but no one seems to work for me.

1. EXEC INSERT_AUTONUMBER_DATA(......)

2. BEGIN INSERT_AUTONUMBER_DATA(........) END;

I don’t want to modify much of the code, as it might impact the other areas.

I can add a Callable Statement in the batch, but for this, I will need to modify all the methods and classes which takes responsibility for preparing the batch which are around 15 in my project (Project Design is not very good), plus I will have to write a condition identifying a procedure call, so that I will prepare a callable statement instead of a Statement.

Is there any other way of doing it, without changing the classes executing the batches?

  • 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-13T02:12:01+00:00Added an answer on June 13, 2026 at 2:12 am

    I tried the following call statement to add in the batch.

    CALL INSERT_AUTONUMBER_DATA(......)
    

    This String is getting added in a Statement with the following logic and it works.

    Statement s = conn.createStatement();
    s.addBatch("CALL INSERT_AUTONUMBER_DATA(......)");
    s.addBatch(.....);
    .
    .
    .
    
    s.executeBatch();
    

    So, here I am able to call a procedure via java.sql.Statement in a Batch

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

Sidebar

Related Questions

We are working on Java web project based on JPA 2, Hibernate, Spring 3
I am working on a java ant + ivy based project that has the
I'm currently working on a project that is building a java-based desktop application to
i am working on a java-struts based project. I really don't know how to
I'm working on my first GWT-based Java project for a school assignment. It's a
I'm learning Java and working on a guessingGame project based on a grid and
I am currently working on a project for school, it is Java based and
I'm currently working on large C++ Qt based project which is a about to
I am working on Java GUI project. I have several components on the swing-based
I'm currently working a project which based on spring MVC, it's just a standard

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.