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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:00:16+00:00 2026-05-17T15:00:16+00:00

How can I fix this OutOfBoundsException ? Here is the code I am using:

  • 0

How can I fix this OutOfBoundsException?

Here is the code I am using:

 ResultSet rsTagCheck = stmt.executeQuery(
     "SELECT PARKING.XKRPRMT.XKRPRMT_PIDM, PARKING.XKRPRMT.XKRPRMT_STATUS, PARKING.XKRPRMT.XKRPRMT_EXPIRE_YR, PARKING.XKRPRMT.XKRPRMT_TAG FROM PARKING.XKRPRMT WHERE XKRPRMT_PIDM ='" + BannerID + "'");
 while (rsTagCheck.next()){
     String TagNum = rsTagCheck.getString("XKRPRMT_TAG");
     ArrayList<String> myTag = new ArrayList<String>();

     for (int i = 0; i < TagNum.length(); i++){
         myTag.add(TagNum);
         myTag.get(i + i);

I kinda know why I am getting the error, but I am not sure how to remedy the problem.

  • 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-17T15:00:16+00:00Added an answer on May 17, 2026 at 3:00 pm

    What is it that you expect myTag.get(i + i) to do?

    The first time through the loop, “i” is zero and you add one element. There won’t be an element 1, so the call will throw an exception. Now that I actually see what you wrote, it’ll fail on the second iteration, not the first, as poor @Giu noted in his now-deleted answer. Still, it’s weird and I don’t know what you’re trying to accomplish by calling .get() and not even looking at the return value.

    You really will have to explain what it is you’re trying to do, because that doesn’t really make any sense as written. Did the exception in the question title really come from that code, or did you edit part of it out when posting?

    edit — whoops totally saw “i+i” as “i+1”. Still makes no sense to me however.

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

Sidebar

Related Questions

Ok I want some opinions how I can fix this mess of a method!
Does anyone have an idea how can I fix this vulnerability in Apache 2.2.4
I've been trying to fix this for two hours straight and I can't figure
This sure seems like a simple error to fix. However, I somehow can't figure
ModelMultipleChoiceField doesn't select initial choices and I can't make the following fix (link below)
I can fix this problem by messing with outher parts of my codebase but
Hope someone can fix this (hopefully simple) issue I'm having. We've got a Google
How I can fix this? Tdm = class(TDataModule) HTTP: TIdHTTP; XMLDoc: TXMLDocument; ... var
I wonder how I can fix this propabably easy problem. Ive installed the color
Using scons I can easily set my include paths: env.Append( CPPPATH=['foo'] ) This passes

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.