Bug #2855 ResultSetMetaData.getColumnClassName() return wrong type for FLOAT
Submitted: 17 Feb 2004 23:40 Modified: 18 Feb 2004 13:51
Reporter: [ name withheld ] Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:3.0.10 OS:Java
Assigned to: CPU Architecture:Any

[17 Feb 2004 23:40] [ name withheld ]
Description:
To be consistent with ResultSet.getColumnClassName() in the case of a FLOAT, 
ResultSetMetaData.getObject() 
should return "java.lang.Double" not "java.lang.Float"

The behavior of ResultSet.getColumnClassName() is appropriate per Table 9.3 at http://java.sun.com/
j2se/1.4.2/docs/guide/jdbc/getstart/mapping.html

How to repeat:
Invoke ResultSetMetaData.getColumnClassName() on a FLOAT

Suggested fix:
    public String getColumnClassName(int column) throws SQLException {

...

        case Types.REAL:
        case Types.FLOAT:
            return "java.lang.Float";

        case Types.DOUBLE:
            return "java.lang.Double";

should become:

        case Types.REAL:
            return "java.lang.Float";

        case Types.FLOAT:
       case Types.DOUBLE:
            return "java.lang.Double";

...
[18 Feb 2004 13:51] Mark Matthews
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html