JDBC: Protocol confusion retrieving result of " SELECT @@IDENTITY"

Emmanuel Blot eblot at jijia12.grenoble.hp.com
Wed Jul 12 12:31:10 EDT 2000


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')
> 




More information about the FreeTDS mailing list