logo       


Re: QueryForObject returns wrong data: msg#00367

Subject: Re: QueryForObject returns wrong data
Larry Meadors <larry.meadors <at> gmail.com> writes:

> 
> 
> Do you need to set the scale on the bigdecimal variable?
> 
> On 7/26/05, shilpa <shilpa.pradhan <at> judiciary.state.nj.us
> > wrote:Prashanth Sukumaran <prashanthsukumaran <at> 
> yahoo.com> writes:>> Hi Shilpa,>> Just in case, have you defined the bean 
variable as int/integer by mistake.>> Rgds>> Prashanth.>> --- shilpa <
> shilpa.pradhan <at> judiciary.state.nj.us> 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 financialStatus as object.> >> 
> 
> sqlMap.queryForObject("selectFinancialInfo",finStatus);> >> > I am using 
Stored Procedures to retrieve data from DB2.> >> > I have a field in 
table 'SocialSecurity' with value 
> 99.44> >> > but when I execute> >> > sqlMap.queryForObject
("selectFinancialInfo",finStatus);> >> > and call finStatus.getSocialSecurity
();> > its just returning me 99 and not 
> 99.44> >> > My stored procedure is not returning a ResultSet but everything 
in OUT> > parameters.> >> > Same procedure works fine with normal JDBC code. 
(returns 99.44)
> > >> > Can you please guide me, where I am doing wrong.> >> > Thanks,> > 
shilpa> >> >> >> >> >> >> >>
> > __________________________________________________> Do You Yahoo!?> Tired 
of spam?  Yahoo! Mail has the best spam protection around> http://mail.yahoo.com
> >>no its BigDecimalBigDecimal financialSocialsecurity;getter/setters for 
thatpublic BigDecimal getFinancialSocialsecurity() 
{                System.out.println("financialSocialsecurity"
> +financialSocialsecurity); // this returns wrong data i.e. 
99                return financialSocialsecurity;}public void 
setFinancialSocialsecurity(BigDecimal decimal) 
{                financialSocialsecurity
> = decimal;}Thanks,shilpa
> 
> 
> 
> 

yes, as data type in my stored procedure is Decimal. 
And one more thing , I have another stored procedure, which access same field 
from table, only difference is, this stored procedure is returning me ResultSet 
(more than one record), So for this I am using sqlMap.QueryForList() and it 
returns me correct data, but queryForObject() fails.

Is it a problem with QueryForObject() ???

Thanks,
shilpa







Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
Search:
Java, servers, webhosting, windows, cisco ...
more...
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
encryption.gpg....    ietf.rfc822/199...    freebsd.devel.i...    lang.haskell.li...    mail.squirrelma...    web.zope.plone....    yellowdog.gener...    text.xml.xalan....    recreation.phot...    kde.devel.educa...    hardware.bus.ca...    printing.ghosts...    voip.peering/20...    assembly/2006-0...    org.user-groups...    culture.interne...    network.i2p/200...    boot-loaders.ya...    xfree86.render/...    qnx.openqnx.dev...    jakarta.velocit...    user-groups.pal...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe