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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:56:52+00:00 2026-05-22T01:56:52+00:00

Here is the HTML from my .jsp page: <tr> <td><input type=checkbox name=<%=editID%>COM /> </td>

  • 0

Here is the HTML from my .jsp page:

<tr>
  <td><input type="checkbox" name=<%=editID%>COM /> </td>    
  <td>blah blah</td>
  <td>blah blah</td>
</tr>

So here the user will select checkboxes and submit them to be deleted. But I want them to be able to select multiple checkboxes. For instance, if they chose two checkboxes, say #’s 5 and 6, it will come to the servlet as 5COM and 6COM (this is due to bad table design). So next, I am trying to get multiple parameters from my jsp page, and write them to my database in my servlet. Here are my definitions:

  String[] comEdit = request.getParameterValues("editIDCom");   
  String comEditDel = "";
  int[] comEditDels = null;

So using the above example, the comEdit array should contain 5COM and 6COM….Next, I am trying to get the substring of every item in the array ‘comEdit’ and then I am trying to put it into a int Array:

  for (int i = 0; i < comEdit.length; ++i) {
      String com = comEdit[i];
      comEditDel = com.substring(0, com.length() - 3);    
      comEditDels = new int[comEditDel == null ? 0: comEditDel.length];
      comEditDels[i] = Integer.parseInt(comEditDel[i]);
  }

So sticking with the same example, I am trying to make a new int Array that will give me [5, 6]….Now the above part is most likely incorrect, but I gave it a shot, and you can see my intentions. Here I am trying to use the array in my callable statement:

    CallableStatement stmt = null;
    PreparedStatement pstmt = null;
    Connection conn = null;
    ArrayDescriptor ad = null;
    String dSource = getServletContext().getInitParameter("dataSource");

   stmt = conn.prepareCall("{?= call My_function(?)}");
   stmt.registerOutParameter(1, Types.INTEGER);
   ad = ArrayDescriptor.createDescriptor("NUM_ARRAY", conn);
   stmt.setArray(2,new ARRAY(ad, conn, comeditDels));

So again, using the example, the stmt.setArray function should send the array [5,6] to My_function. Again this is my attempt, and it is prob incorrect? Any help is appreciated. Thanks!

  • 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-22T01:56:53+00:00Added an answer on May 22, 2026 at 1:56 am

    Based on your reply to my comment, does this do what you want?

    String[] comEdit = request.getParameterValues("editIDCom");   
    int[] comEditDels = null;
    
    if (comEdit != null) {
        comEditDels = new int[comEdit.length];
    
        for (int i = 0; i < comEdit.length; ++i) {
            String com = comEdit[i];
            if (com != null && com.length() - 3 > 0) {
                try {
                    comEditDels[i] = Integer.parseInt(com.substring(0, com.length() - 3));
                } catch (NumberFormatException exception) {
                    // do something or possibly ignore since the value isn't a valid integer
                }
            }
        }
    }
    
    if (comEditDels != null) {
        CallableStatement stmt = null;
        PreparedStatement pstmt = null;
        Connection conn = null;
        ArrayDescriptor ad = null;
        String dSource = getServletContext().getInitParameter("dataSource");
    
        stmt = conn.prepareCall("{?= call My_function(?,?,?,?)}");
        stmt.registerOutParameter(1, Types.INTEGER);
        ad = ArrayDescriptor.createDescriptor("NUM_ARRAY", conn);
        stmt.setArray(2,new ARRAY(ad, conn, comEditDels));
    }
    

    I’m not familiar with those Oracle objects so I’m not sure what to expect from passing in ‘comEditDels’ that way, but I’m thinking that’s what you want?

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

Sidebar

Related Questions

As I mentioned here , I'm trying to generate HTML from an ASPX page
Here are the problem scripts: This is from the HTML file: <script type=text/javascript> var
Here is an example of polymorphism from http://www.cplusplus.com/doc/tutorial/polymorphism.html (edited for readability): // abstract base
I downloaded the swc file from here: http://developer.yahoo.com/maps/flash/flexGettingStarted.html And put it in my flex
I need a little help here: I get a file from an HTML upload
I have html like so: <div class=foo> (<a href=forum.example.com>forum</a>) <p> Some html here.... </div>
I am trying to send an email (using Outlook mail) from a jsp page.
I have a JSP page running in Tomcat that is not rendering properly. Here
I have a jsp page that is trying to reference some user defined classes.
i am building a login page using HTML and JSP. But every time i

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.