How to use ResultSet of java to get precise value of float of mysql -


is possible in java, use resultset, precise value of float of mysql?

in database of mysql, have values of float long(for example, 123456789, more 7 digits), know if use select round(float_value_column,0) can precise value. if use resultset.getfloat of java, can rounded value(123457000, in mysql made select float_value_column).

may ask, if use resultset.getdouble, may precise value? or may resultset.getfloat(round(float_value_column,0))?

thank much

you can try below code

resultset rs = .....      bigdecimal myvalue = rs.getbigdecimal("column name");             float myfloatvalue = myvalue.floatvalue(); 

more bigdecimal here.

you can have @ sow post well.


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -