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
Post a Comment