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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:22:16+00:00 2026-06-18T02:22:16+00:00

Im building a large database call using PreparedStatement that has 2000+ parameter markers. Im

  • 0

Im building a large database call using PreparedStatement that has 2000+ parameter markers.

Im getting this error

Caused by: java.sql.SQLException: Prepared or callable statement has more than 2000 parameter markers.
    at net.sourceforge.jtds.jdbc.SQLParser.parse(SQLParser.java:1139)
    at net.sourceforge.jtds.jdbc.SQLParser.parse(SQLParser.java:156)
    at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.<init>(JtdsPreparedStatement.java:107)
Caused by: java.sql.SQLException: Prepared or callable statement has more than 2000 parameter markers. 

I tried searching the API Docs and google but couldnt find how to configure this.

Does anyone know if it is possible to up this limit? I am aware it is going to be a slow database call but that is fine for now.

Also will this cause me any issues in the long run, would I be better off running it in 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-18T02:22:17+00:00Added an answer on June 18, 2026 at 2:22 am

    Seams like you’re stuck at 2000. Here is a cut out from the driver source.

    if (params != null && params.size() > 255
         && connection.getPrepareSql() != TdsCore.UNPREPARED
         && procName != null) {
      int limit = 255; // SQL 6.5 and Sybase < 12.50
      if (connection.getServerType() == Driver.SYBASE) {
        if (connection.getDatabaseMajorVersion() > 12 ||
            connection.getDatabaseMajorVersion() == 12 &&
            connection.getDatabaseMinorVersion() >= 50) {
          limit = 2000; // Actually 2048 but allow some head room
        }
      } else {
        if (connection.getDatabaseMajorVersion() == 7) {
          limit = 1000; // Actually 1024
        } else if (connection.getDatabaseMajorVersion() > 7) {
          limit = 2000; // Actually 2100
        }
      }
      if (params.size() > limit) {
       throw new SQLException(
           Messages.get("error.parsesql.toomanyparams",
           Integer.toString(limit)),
           "22025");
      }
    }
    

    Here are a blog with examples on how to solve it.

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

Sidebar

Related Questions

I am building a Django powered web app that has a large database component.
I'm building a rather large database - which has around 6.9 million records. A
I'm building a rather large project, that basically consists of this: Server 1: Ice
I am building a small website that has a fairly large amount of pictures
I'm building a large Java application that uses multiple pop-up windows. Some of these
I'm tasked with building a large eCommerce site for a retailer. We are using
I'm building a fairly large enterprise application made in python that on its first
I'm building a site in django that interfaces with a large program written in
I am building a Mondrian Cube that shows information for a large range of
I'm building a social networking type site that will be storing large chunks of

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.