logo       


Re: QueryForObject returns wrong data: msg#00378

Subject: Re: QueryForObject returns wrong data
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@xxxxxxxxxxxxxxxxxxxxx 07/27/05 1:00 PM >>>
Jeff Butler <dhscn06 <at> 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 accept the
scale
> argument.  My guess is that the DB2 driver is setting the scale to
zero
> in this case.
> 
> Before we all start screaming at IBM, please note that the JavaDoc
for
> this method explicitly states that this method should not be used in
the
> case of DECIMAL and NUMERIC types.
> 
> Here's a link to the JavaDoc...
> 
> 
http://java.sun.com/j2se/1.4.2/docs/api/java/sql/CallableStatement.html#register

OutParameter(java.lang.String,
> int)
> 
> I'm guessing this is the problem.  The solution is somewhat more
> evasive...
> 
> Jeff Butler
> 
> 

But I am doing same thing using normal JDBC call also. In that case I
am 
getting correct value and also if I call scale() method on my
bigDecimal 
Property, its returning me '2', that means, DB2 is returning me 99.44
using 
normal JDBC API, with same value object.

Thanks for your reply,
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