Re: QueryForObject returns wrong data

2005-07-28 Thread Jeff Butler
:( Unfortunately, that's not an easy upgrade to convince management about. I've submitted an enhancement request for this problem (IBATIS-176), and also attached a simple test case showing how to use stored procedure DECIMAL output parms with iBatis. The enhancement should be quite simple to do

Re: QueryForObject returns wrong data

2005-07-28 Thread shilpa
Jeff Butler cstone.dhs.state.il.us> writes: > > Shilpa, > > I cannot get this to fail using DB2 version 8.2, fixpack 9a. I have > used both the type 2 and type 4 drivers, and I get the correct results > in each case (even calling the SP multiple times - works every time). > > I still believe

Re: QueryForObject returns wrong data

2005-07-28 Thread shilpa
Prashanth Sukumaran yahoo.com> writes: > > Hi Jeff, > > I don't know how the scale would work. > > As per jdk 1.4 there are 4 constructors to create BigDecimal. The first two use biginteger, i > think this will not be a case at BigInteger would not be mapped to Decimal type field. > > The

Re: QueryForObject returns wrong data

2005-07-27 Thread Prashanth Sukumaran
Hi Jeff, I don't know how the scale would work. As per jdk 1.4 there are 4 constructors to create BigDecimal. The first two use biginteger, i think this will not be a case at BigInteger would not be mapped to Decimal type field. The other two use double or string. In both cases the value is

Re: QueryForObject returns wrong data

2005-07-27 Thread Jeff Butler
Shilpa, I cannot get this to fail using DB2 version 8.2, fixpack 9a. I have used both the type 2 and type 4 drivers, and I get the correct results in each case (even calling the SP multiple times - works every time). I still believe this is something that should be changed in iBATIS - just to ma

Re: QueryForObject returns wrong data

2005-07-27 Thread Larry Meadors
Well, you can always get the source from SVN and build it. If you do that, please share the changes, and we will get them incorporated faster. Larry On 7/27/05, shilpa <[EMAIL PROTECTED]> wrote: shilpa judiciary.state.nj.us> writes:>> Hi,>> It may sound little strange, but I am getting wrong

Re: QueryForObject returns wrong data

2005-07-27 Thread shilpa
shilpa judiciary.state.nj.us> writes: > > Hi, > > It may sound little strange, but I am getting wrong data back when I call > QueryForObject( ) method and try to get firld of Decimal data type. > > e.g > I am calling this method by passing financialStatus as object. > > sqlMap.queryForO

Re: QueryForObject returns wrong data

2005-07-27 Thread Jeff Butler
OK. Unless Shilpa beats me to it, I'll enter the bug later this evening. I'll include a small test that demonstrates the problem - it will be dependant on a DB2 stored procedure (which I will also include). Jeff Butler >>> [EMAIL PROTECTED] 07/27/05 2:56 PM >>> On 7/27/05, Jeff Butler <[EMAIL PR

Re: QueryForObject returns wrong data

2005-07-27 Thread Larry Meadors
On 7/27/05, Jeff Butler <[EMAIL PROTECTED]> wrote: I think we have the answer.  I don't know why it works even the firsttime without specifying the scale.  Weird.Anyway, iBATIS does not currently offer a way to set the scale onoutput parameters.  I think what's needed is a change to the parameter m

Re: QueryForObject returns wrong data

2005-07-27 Thread Jeff Butler
I think we have the answer. I don't know why it works even the first time without specifying the scale. Weird. Anyway, iBATIS does not currently offer a way to set the scale on output parameters. I think what's needed is a change to the parameter map so you can specify scale like this: Then

Re: QueryForObject returns wrong data

2005-07-27 Thread shilpa
Jeff Butler cstone.dhs.state.il.us> writes: > > Do you mean that in straight JDBC you call registerOutputParameter > without specifying the scale? > > If so, then I'm back to being stumped. > > Jeff Butler > > >>> shilpa.pradhan judiciary.state.nj.us 07/27/05 1:00 PM >>> > Jeff Butler cston

Re: QueryForObject returns wrong data

2005-07-27 Thread Jeff Butler
Do you mean that in straight JDBC you call registerOutputParameter without specifying the scale? If so, then I'm back to being stumped. Jeff Butler >>> [EMAIL PROTECTED] 07/27/05 1:00 PM >>> Jeff Butler cstone.dhs.state.il.us> writes: > > Unfortunately, I think this could be an iBATIS issue..

Re: QueryForObject returns wrong data

2005-07-27 Thread shilpa
Jeff Butler cstone.dhs.state.il.us> writes: > > Unfortunately, I think this could be an iBATIS issue... > > In the class com.ibatis.sqlmap.engine.execution.SqlExecuter, the method > "registerOutputParameters" always calls the version of > CallableStatement.registerOutputParameter that does not

Re: QueryForObject returns wrong data

2005-07-27 Thread Jeff Butler
Unfortunately, I think this could be an iBATIS issue... In the class com.ibatis.sqlmap.engine.execution.SqlExecuter, the method "registerOutputParameters" always calls the version of CallableStatement.registerOutputParameter that does not accept the scale argument. My guess is that the DB2 driver

Re: QueryForObject returns wrong data

2005-07-27 Thread Ed Griebel
You could also try changing your sqlmap parameter to This works for us in many places, using Oracle DB. -ed On 7/27/05, Daniel Henrique Ferreira e Silva <[EMAIL PROTECTED]> wrote: > Hi Shilpa, > > Really, this issue seems way weird. > I have some points, maybe all wrong, but they are my best

Re: QueryForObject returns wrong data

2005-07-27 Thread Daniel Henrique Ferreira e Silva
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 yo

Re: QueryForObject returns wrong data

2005-07-27 Thread shilpa
Daniel Henrique Ferreira e Silva gmail.com> writes: > > 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(BigDecim

Re: QueryForObject returns wrong data

2005-07-27 Thread Daniel Henrique Ferreira e Silva
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 = val; this.myBigDecimalP

Re: QueryForObject returns wrong data

2005-07-27 Thread shilpa
Larry Meadors gmail.com> writes: > > What I mean is if you set the scale on the object, is the real value 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 its showing me just 99. I called

Re: QueryForObject returns wrong data

2005-07-27 Thread shilpa
Larry Meadors gmail.com> writes: > > What I mean is if you set the scale on the object, is the real value there? > yourBigDecimal.setScale(2); > Larry No there is no real value there.

Re: QueryForObject returns wrong data

2005-07-27 Thread shilpa
Larry Meadors gmail.com> writes: > > What I mean is if you set the scale on the object, is the real value there? > yourBigDecimal.setScale(2); > Larry Where I need to set this? In my value object? I have a Value object as : public class FinancialStatus { BigDecimal financialSocialsecurity;

Re: QueryForObject returns wrong data

2005-07-27 Thread Larry Meadors
What I mean is if you set the scale on the object, is the real value there? yourBigDecimal.setScale(2); Larry

Re: QueryForObject returns wrong data

2005-07-27 Thread shilpa
Larry Meadors gmail.com> writes: > > > Do you need to set the scale on the bigdecimal variable? > > On 7/26/05, shilpa judiciary.state.nj.us > > wrote:Prashanth Sukumaran > yahoo.com> writes:>> Hi Shilpa,>> Just in case, have you defined the bean variable as int/integer by mistake.>> Rgds>

Re: QueryForObject returns wrong data

2005-07-26 Thread Larry Meadors
Do you need to set the scale on the bigdecimal variable?On 7/26/05, shilpa <[EMAIL PROTECTED] > wrote:Prashanth Sukumaran yahoo.com> writes:>> Hi Shilpa,>> Just in case, have you defined the bean variable as int/integer by mistake.>> Rgds>> Prashanth.>> --- shilpa < shilpa.pradhan judiciary.stat

Re: QueryForObject returns wrong data

2005-07-26 Thread shilpa
Prashanth Sukumaran yahoo.com> writes: > > Hi Shilpa, > > Just in case, have you defined the bean variable as int/integer by mistake. > > Rgds > > Prashanth. > > --- shilpa judiciary.state.nj.us> wrote: > > > Hi, > > > > It may sound little strange, but I am getting wrong data back wh

Re: QueryForObject returns wrong data

2005-07-26 Thread Prashanth Sukumaran
Hi Shilpa, Just in case, have you defined the bean variable as int/integer by mistake. Rgds Prashanth. --- shilpa <[EMAIL PROTECTED]> wrote: > Hi, > > It may sound little strange, but I am getting wrong data back when I call > QueryForObject( ) method and try to get firld of Decimal data

Re: QueryForObject returns wrong data

2005-07-26 Thread shilpa
Nathan Maves Sun.COM> writes: > > Can you send your xml code? (ResultMap, SQLMap) > > Nathan > > On Jul 26, 2005, at 2:50 PM, shilpa wrote: > > > Hi, > > > > It may sound little strange, but I am getting wrong data back > > when I call > > QueryForObject( ) method and try to get fi

Re: QueryForObject returns wrong data

2005-07-26 Thread Nathan Maves
Can you send your xml code? (ResultMap, SQLMap) Nathan On Jul 26, 2005, at 2:50 PM, shilpa wrote: Hi, It may sound little strange, but I am getting wrong data back when I call QueryForObject( ) method and try to get firld of Decimal data type. e.g I am calling this method by passing

QueryForObject returns wrong data

2005-07-26 Thread shilpa
Hi, It may sound little strange, but I am getting wrong data back when I call QueryForObject( ) method and try to get firld of Decimal data type. e.g I am calling this method by passing financialStatus as object. sqlMap.queryForObject("selectFinancialInfo",finStatus); I am using Stored Pr