File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
JDBC and Relational Databases
Urgent help - DB2 type 4 driver returns 0E-8 for decimal value
Joined: Jun 05, 2006
Jul 08, 2010 01:37:28
We are using DB2 type 4 driver and Spring
for DB communications. We have a column "COLUMN1" defined as DECIMAL(15,2).
The Spring-defination for this column is as
<bean id="OUT_COLUMN1" class="org.springframework.jdbc.core.SqlOutParameter"> <constructor-arg index="0" value="COLUMN1" /> <constructor-arg index="1"> <value>3</value> //3 represents Decimal </constructor-arg> </bean> //Java code to get the value from output map BigDecimal COLUMN1 = (BigDecimal)outMap.get("COLUMN1"); System.out.println("COLUMN1 value ::: "+COLUMN1.doubleValue());
After executing stored procedure, when I try to get value for "COLUMN1" from output map , it returns me "0E-8".
What is most annoying is,it returns me "0E-8" , whether column value is "0.000" or "1234.56" or "56673.67".
Bottom line is , I am always getting "0E-8".
Please, let me know if you need more input.
Thanks in advance
Cheers<br />-------------<br />Swapnil<br /> <br />SCJP5-81%<br /> <br />"Dictionary is the only place where Success come before Work"
Joined: Oct 13, 2005
Jul 08, 2010 04:36:19
no such thing as "urgent".
I agree. Here's the link:
subject: Urgent help - DB2 type 4 driver returns 0E-8 for decimal value
use a bean with a constructor in spring
If Someone Would Help Me to Understand a Spring Configuration Snippet
problens in spring CustomDataEditor!
different behavior with db2 driver, type 4
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015