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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:01:59+00:00 2026-05-26T23:01:59+00:00

I am using JTDS with Java to connect to a Microsoft SQL database. I

  • 0

I am using JTDS with Java to connect to a Microsoft SQL database. I am able to connect to the database perfectly. However when I run the code below, I am getting an error “Could not find stored procedure ‘get_queue_items’ “. I’ve tried prefixing ‘dbo.’ to the stored procedure name, however I continue to get the error. I’ve also included the actual stored procedure for reference.

try {
    // Prepare and call the stored procedure
    CallableStatement proc = connection.prepareCall("{call get_queue_items(?) }");

    // Register the ResultSet
    proc.registerOutParameter(1, java.sql.Types.INTEGER);

    // Register Input Parameters
    proc.setInt("@last_queue_entry", 1);

    // Execute the stored procedure
    proc.execute();

    // If we have a ResultSet
    if (proc.getMoreResults()) {
        ResultSet rs = proc.getResultSet();
        if (rs.next()) {
            // to complete...
        }
    }
}
catch(Exception ex)
{
    System.out.println("Error: " + ex.getMessage());
}

And the stored procedure:

USE [test]
GO
/****** Object:  StoredProcedure [dbo].[get_queue_items]    Script Date: 11/17/2011 11:43:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[get_queue_items] @qid int OUT, @last_queue_entry int as
-- select all the new records out of the main table into a temp table
-- the temp table is what we will use to process

select @qid = qid from test.[dbo].que_items
where qid > @last_queue_entry

I’m new to JTDS and Java, so its likely I am at fault, but any help would be appreciated.

Edit: Changed the Stored Procedure as per Cristian’s advice, still getting the same error ‘Could not find stored procedure ‘get_queue_items’

Edit 2: Still not working – database connectivity seems fine also.

  • 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-26T23:02:00+00:00Added an answer on May 26, 2026 at 11:02 pm

    Today I met same problem and it seems to me that there is a bug in jTDS implementation. For me solution was procedure renaming and removing all underscore symbols (that is getQueueItems(?) in your case). Try, I think it must help to you.

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

Sidebar

Related Questions

I am using JTDS to connect to MS-SQL 2005. I am using c3p0 as
I am using jtds drivers to connect to SQL Server on local using Hibernate
we're comparing JTDS and Microsoft SQL Server for a Java EE application running on
I'm using JTDS as a driver to connect to SQL server. Here's the query
We run a website written in Java that uses JDBC with jTDS to access
Using a Microsoft version of SQL, here's my simple query. If I query a
I am using playframework with a legacy SQL Server 2008 database that has data
I'm using eclipse, trying to connect to a sql server db. I have the
Using Java schemacrawler , why is it scanning every table in my database? Shouldn't
I am trying to connect Sql Server Data Base using windows authentication from my

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.