Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 69336 invoked from network); 27 Jul 2005 17:32:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 27 Jul 2005 17:32:19 -0000 Received: (qmail 81525 invoked by uid 500); 27 Jul 2005 17:32:18 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 81203 invoked by uid 500); 27 Jul 2005 17:32:17 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 81190 invoked by uid 99); 27 Jul 2005 17:32:17 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jul 2005 10:32:17 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of dhsilva@gmail.com designates 64.233.184.204 as permitted sender) Received: from [64.233.184.204] (HELO wproxy.gmail.com) (64.233.184.204) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jul 2005 10:32:10 -0700 Received: by wproxy.gmail.com with SMTP id i24so218586wra for ; Wed, 27 Jul 2005 10:32:15 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=lQPqvNAEBLKByEETDT5/Yogj7Ol3g2GFll5Dy7Pv4UvEl5uhsRFNQyNbFAr/Rt4W1hvPFdrM/CNu28o1Vc7x4vDzJeWsFl5+LkiInuwCnP1aEm8TndcBL7hhfluizma6tTZICyWw9GvXgXo+G2bW+wp/tZbu7KwRUslXRAUDdHA= Received: by 10.54.30.23 with SMTP id d23mr433974wrd; Wed, 27 Jul 2005 10:32:15 -0700 (PDT) Received: by 10.54.71.9 with HTTP; Wed, 27 Jul 2005 10:32:15 -0700 (PDT) Message-ID: <762ca9ae05072710326750ec1b@mail.gmail.com> Date: Wed, 27 Jul 2005 14:32:15 -0300 From: Daniel Henrique Ferreira e Silva Reply-To: Daniel Henrique Ferreira e Silva To: user-java@ibatis.apache.org Subject: Re: QueryForObject returns wrong data In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20050726210422.62458.qmail@web53111.mail.yahoo.com> <762ca9ae0507271010de7b9b2@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Shilpa, Really, this issue seems way weird. I have some points, maybe all wrong, but they are my best shots: 1) This problem may be caused by a buggy jdbc driver; 2) This problem may be caused by a bug in iBATIS (probably not or someone would already pointed it); Besides those points, have you tried changing your property from BigDecimal to Double? What happens after that change? Cheers, Daniel Silva. On 7/27/05, shilpa wrote: > Daniel Henrique Ferreira e Silva gmail.com> writes: >=20 > > > > Shilpa, > > > > That is exactly the point Larry tried to show you. As your BigDecimal > > has scale 0, it shows you only the integer part of the value. Set it > > to 2, for example, in your setter: > > > > public void setMyBigDecimalProperty(BigDecimal val) { > > this.myBigDecimalProperty =3D val; > > this.myBigDecimalProperty.setScale(2); > > } > > > > Apparently, that will solve your issue. > > Let me know what you get doing that. > > > > Cheers, > > Daniel Silva. > > > > On 7/27/05, shilpa judiciary.state.nj.us> wrote: > > > Larry Meadors gmail.com> writes: > > > > > > > > > > > What I mean is if you set the scale on the object, is the real valu= e > there? > > > > yourBigDecimal.setScale(2); > > > > Larry > > > > > > > > > I am geting only 99 from iBatis, not 99.11 > > > I am printing what I am getting in set method of value object, and it= s > showing > > > me just 99. I called scale() method on BigDecimal object returned by = iBatis, > > > and its giving me '0'. > > > > > > What could be the problem? > > > > > > Lot of other people at my work place is also facing the same problem. > > > > > > Can anyone help us regarding this? > > > > > > Thanks, > > > Shilpa > > > > > > > > > > > > > > > > > > > >=20 > now its giving me 99.00 and not 99.11 >=20 > This is my set method >=20 > public void setFinancialSocialsecurity(BigDecimal decimal) { >=20 > System.out.println("setfinancialSocialsecurity " + decima= l); >=20 > financialSocialsecurity =3D decimal.setScale(2); > System.out.println("setfinancialSocialsecurity scale" + > decimal.scale()); > } >=20 >=20 >=20 >=20 >=20 >=20 >