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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:02:15+00:00 2026-06-02T08:02:15+00:00

I am generating a table and inserting the data into that table. The table

  • 0

I am generating a table and inserting the data into that table. The table is created from data that has complex relationships. We created this so users of our BI tool could easily deal with the data.

We have a bunch of these tables that get created each one is different based on the user generated data. In one case we are getting index out of range exception. When inspecting the meta data it is not out of range.

The exact exception message is:

com.microsoft.sqlserver.jdbc.SQLServerException: The index 13 is out of range.

The generated insert statement is:

INSERT INTO [F22_AF] ([frcId],[eId],[aId],[dateCreated],[DateofThing],[Wasthisaninjury],[Whowainjured],[WhowainjuredFNAME],[WhowainjuredLNAME],[Whatwasinvolved],[WhatwasinvolvedDATA],[WhatOptionsWereAvailable],[AccidentWitnessed]) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)

When the value for accident witnessed is set the exception is thrown. When the value is about to be set I printed the column index and the value:

13 : AccidentWitnessed = false

When it fails I printed out the meta data from the insert statement and got this:

parameterMetaData.getParameterCount()=13

ColIndex – Type || Class

1 – int || java.lang.Integer

2 – int || java.lang.Integer

3 – int || java.lang.Integer

4 – datetime || java.sql.Timestamp

5 – datetime || java.sql.Timestamp

6 – nvarchar || java.lang.String

7 – int || java.lang.Integer

8 – nvarchar || java.lang.String

9 – nvarchar || java.lang.String

10 – int || java.lang.Integer

11 – nvarchar || java.lang.String

12 – int || java.lang.Integer

13 – bit || java.lang.Boolean

When I try to set col index 13 I get Index Out Of Range, however according to the meta data it exists! If it didn’t exist I would get another out of range exception.

The same code works for a different set of data.

Can anyone explain why this error would occur when the column index exists?

  • 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-02T08:02:16+00:00Added an answer on June 2, 2026 at 8:02 am

    My advice? Believe the JVM. It doesn’t matter what you think.

    You’re not looking at the right spot to understand what’s going wrong. Write a small, self-contained example and run it in a debugger. You’ll be able to see where the code is going awry that way.

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

Sidebar

Related Questions

So I have this simple PHP loop that is generating html table data with
I have a PHP loop that's auto-generating an array to INSERT into a table.
A PHP script is generating the following table panel based on the data from
Does anyone have a technique for generating SQL table create (and data insert) commands
I am dynamically generating rows of a table from the ajax response I am
I've been tasked with the awesome job of generating a look-up table for our
I have an MVC application view that is generating quite a large HTML table
I am using mysql_real_escape_string function while inserting the data into MySQL database. I am
Short Generating table with barcodes of items. Each item has exact quantity in database
I have problem with generating and inserting xml in existing document. <table:table table:template-name=default> <table:table-column

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.