Skip to Content.
Sympa Menu

freetds - Re: Protocol confusion for stored procedure invocation [was: JDBC driver error]

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Spectron Caribe, Inc." <spectron AT caribe.net>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: Re: Protocol confusion for stored procedure invocation [was: JDBC driver error]
  • Date: Mon, 30 Apr 2001 12:07:27 -0400



----- Original Message -----
From: "Bob Kline" <bkline AT rksystems.com>
To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
Cc: "Fawzib Rojas" <spectron AT caribe.net>
Sent: Friday, April 27, 2001 5:02 PM
Subject: Re: [freetds] Protocol confusion for stored procedure invocation
[was: JDBC driver error]


> On Fri, 27 Apr 2001, Fawzib Rojas wrote:
>
> > I get the following exception when I'm running a stored procedure
> > that returns a resultset (works on ISQLW in MS SQL 6.5):
> >
> > com.internetcds.jdbc.tds.TdsConfused: Protocol confusion- .....
> >
> > The stored procedure creates temporary tables, cursors and saves all
> > the information in declared variables and in the end just does a
> > select that looks like this:
> >
> > select @var1 as 'var1', @var2 as 'var2'
> >
> > Like I said, in ISQL it looks ok, so I guess it is a bug in the JDBC
> > driver. Is there anything I can do to make this query work?
>
> ---------------------------------------------------------------------
>
> There's a good possibility that the problem you described may have been
> fixed in a more recent version of the driver code. In order for someone
> to reproduce your problem, you need to supply a bit more information.
> At a minimum:
>
> 1. The version(s) of freetds_jdbc you are using.

I downloaded the latest freetds_jdbc.snapshot.jar this morning. It still
gives me the same problem. BTW you mentioned that I had to run `ident
freetds_jdbc.jar'. Where is this 'ident' program found?

> 2. The version(s) of the TDS protocol you are using.

I'm using the default connection string
'jdbc:freetds:sqlserver://COMPUTER/DATABASE

> 3. The version(s) of the JVM you are using.

java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build Blackdown-1.3.0-FCS)
Java HotSpot(TM) Client VM (build Blackdown-1.3.0-FCS, mixed mode)

> 4. Which DBMS you are using (including version and platform).

Microsoft SQL Server 6.50 - 6.50.416 (Intel X86)
Jan 23 1999 14:10:24
Copyright (c) 1988-1997 Microsoft Corporation

> 5. Which platform(s) you are running your client software on.

Debian Linux (woody) uname -a returns:
Linux files 2.2.18pre21 #1 Sat Nov 18 18:47:15 EST 2000 i686 unknown

> 6. Whether the problem is present with the latest snapshot.

Yes it is.

> 7. What other layers are present (e.g., CGI wrappers).

Just the normal servlet stuff.

I think I found out what causes the error. It seems that if I add an exec()
command to the stored procedure it doesnt work.

This procedure will work:

CREATE PROCEDURE msim_testProcedure AS
begin
/* create temporary table */
create table #numbers (number smallint)
/* fill temporary table */
insert into #numbers values(1)
/* return results */
select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20
/* remove table */
drop table #numbers
end

If I change "insert into #numbers values(1)" for "exec('insert into #numbers
values(1)')" it will not work.

Faw





Archive powered by MHonArc 2.6.24.

Top of Page