This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Spring and the fly likes Spring returns a BigDecimal for an Integer RDBMS Column Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring returns a BigDecimal for an Integer RDBMS Column" Watch "Spring returns a BigDecimal for an Integer RDBMS Column" New topic
Author

Spring returns a BigDecimal for an Integer RDBMS Column

Graeme Byers
Ranch Hand

Joined: Apr 16, 2004
Posts: 127
Spring returns a BigDecimal for an Integer RDBMS Column
======================================

"Spring Recipes (covers Spring 3)" page 599 uses a Derby table named
Vehicle with a column : WHEEL INT.

On page 615 the JDBC method
is used with "SELECT * FROM VEHICLE" and within the iteration of the list of maps
there is this line :

All the above looks fine to me - a java.lang.Integer is returned.

But when I try using Oracle XE 11.2.0 table EMP column EMPNO NUMBER(4) a BigDecimal is returned.
(In oracle NUMBER allows both a precision and a scale).

What exactly is going on ? Thank you for any help.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Spring returns a BigDecimal for an Integer RDBMS Column