I have FLOAT column in my oracle db,
When calling ResultSetMetaData.getColumnType() I get java.sql.Types.NUMERIC; instead of java.sql.Types.FLOAT
What is the correct way to get the column type?
Joined: May 05, 2010
As far as I know, there is no FLOAT datatype in Oracle. They are using NUMBER (NUMERIC) which is the SQL-92 standard for numbers (decimals and floats, etc.)
You have to check the NUMERIC attributes to get an idea whether this should represent an Integer or not. For example NUMBER(10,7) is for a float/double.
The corresponding SQL types DECIMAL and NUMERIC are defined in SQL-92 and are very widely implemented. These SQL types take precision and scale parameters. The precision is the total number of decimal digits supported, and the scale is the number of decimal digits after the decimal point. For most DBMSs, the scale is less than or equal to the precision. So for example, the value "12.345" has a precision of 5 and a scale of 3, and the value ".11" has a precision of 2 and a scale of 2. JDBC requires that all DECIMAL and NUMERIC types support both a precision and a scale of at least 15.
1. Make it run - 2. Make it run correctly - 3. Make it pretty OR fast/small - 4. ??? - 5. Profit