File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes 2 decimal points VS 1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "2 decimal points VS 1 " Watch "2 decimal points VS 1 " New topic
Author

2 decimal points VS 1

Ronald Whalen
Ranch Hand

Joined: Mar 27, 2001
Posts: 38
Hi,
Ran into a problem. I am using mySQL as DB. In one table I have 2 different decimals defined in the following way in the schema:
VAR1 DECIMAL(3,1)
VAR2 DECIMAL(5,2)
they are both stored correctly in the DB. Upon retrieval they are both pulled into float primitive vars. The VAR1 appears correctly ( if stored as 8.0 the primitive float value = 8.0) however, the VAR2 appears incorrectly (if stored as 8.00 it appears as 800.0. The code to pull them out of the resultset is identical, naturally different float primitive vars.)
Any help or comments would be appreciated.

thanks,

Ronald Whalen
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: 2 decimal points VS 1
 
Similar Threads
Rules for Constructors (From Study Guide)
Immutable Wrapper Class
Overloading method question
Atomic Variables vs Synchronization
"cannot find symbol variable..."