Re: Column Type for mysql float
Posted by: Filipe Silva
Date: July 09, 2018 12:50PM

MySQL supports the floating point numeric types FLOAT, REAL and DOUBLE [PRECISION] but, contrarily to the SQL standard, by default MySQL treats REAL as a synonym for DOUBLE PRECISION (

Knowing this, Connector/J maps the MySQL types REAL and DOUBLE PRECISION to Java `double` and FLOAT to `float`, but, according to the types mapping table in JDBC specification ( the Java type `double` corresponds to the SQL/JDBC type DOUBLE or FLOAT, and `float` to REAL.

So, this is why your MySQL FLOAT columns get mapped to java.sql.Types.REAL and the DOUBLE/REAL columns get mapped to java.sql.Types.DOUBLE. Other than that, Connector/J internally treats java.sql.Types.FLOAT just as java.sql.Types.DOUBLE.

So, this is not a bug.


Options: ReplyQuote

Written By
July 09, 2018 02:01AM
Re: Column Type for mysql float
July 09, 2018 12:50PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.