Two Laptop Bag*
The moose likes JDBC and the fly likes Mapping to REAL = float Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "Mapping to REAL = float" Watch "Mapping to REAL = float" New topic
Author

Mapping to REAL = float

Nick Widelec
Ranch Hand

Joined: Feb 28, 2013
Posts: 226

In mysql when I do: describe table; I see in the field I previously declared as REAL the following description: float (4,2) unsigned

First of all it says (4,2) and when I try to put from java more than 2 digits like 100.3 it does not pass. maximum is 2 digits to the right of the decimal separator. so maximum I can set as a REAL 99.something.. However the description appearing from the command: DESCRIBE table; in mysql says clearly float (4,2) unsigned.

I noticed also unsigned and indeed I cannot put anything negative.. only positive numbers.. which contradicts the meaning of float in the java world.

I am wondering if it's only mysql which behaves in this way or all the databases? Thanks in advance.




OCAJP 7, OCPJP 7
 
GeeCON Prague 2014
 
subject: Mapping to REAL = float