freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
Re: JDBC: Protocol confusion retrieving result of " SELECT @@IDENTITY"
- From: "Emmanuel Blot" <eblot AT jijia12.grenoble.hp.com>
- To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
- Subject: Re: JDBC: Protocol confusion retrieving result of " SELECT @@IDENTITY"
- Date: Wed, 12 Jul 2000 18:31:10 +0200
It works fine.
Thanks to everyone,
Emmanuel.
----- Original Message -----
From: "Bob Kline" <bkline AT rksystems.com>
To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
Sent: Wednesday, July 12, 2000 5:25 PM
Subject: [freetds] Re: JDBC: Protocol confusion retrieving result of " SELECT
@@IDENTITY"
> On Wed, 12 Jul 2000, Emmanuel Blot wrote:
>
> > Sorry, I am a beginner in both SQL and JDBC.
> >
> > How should I write this cast (and where) ?
> >
>
> Here's another workaround until the patches are in place. Replace the
> method getDecimalValue in Tds.java with the following:
>
> private Object getDecimalValue(int t, int p, int scale)
> throws TdsException, java.io.IOException, NumberFormatException
> {
> int len = comm.getByte() & 0xff;
> if (--len < 1)
> return null;
>
> // RMK 2000-06-10. Deduced from some testing/packet sniffing.
> byte[] bytes = new byte[len];
> int signum = comm.getByte() == 0 ? -1 : 1;
> while (len > 0)
> bytes[--len] = comm.getByte();
> BigInteger bigInt = new BigInteger(signum, bytes);
> return new BigDecimal(bigInt, scale);
> }
>
>
> --
> Bob Kline
> mailto:bkline AT rksystems.com
> http://www.rksystems.com
>
>
> ---
> You are currently subscribed to freetds as: eblot AT sablet.grenoble.hp.com
> To unsubscribe, forward this message to $subst('Email.Unsub')
>
-
Re: JDBC: Protocol confusion retrieving result of " SELECT @@IDENTITY",
Bob Kline, 07/12/2000
- <Possible follow-up(s)>
- Re: JDBC: Protocol confusion retrieving result of " SELECT @@IDENTITY", Emmanuel Blot, 07/12/2000
Archive powered by MHonArc 2.6.24.