Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

rounding off values from a resultset

843854Aug 1 2003 — edited Aug 4 2003
Hi,

I need help with the following problem.

I am connecting to a database called Polyhedra using the JDBC-ODBC bridge, and I am selecting certain fields from one of the tables. Some of the fields have decimal numbers stored in them. When I try getFloat(), getDouble() or any datatype for that matter, the values are getting rounded off. It keeps the number as a decimal, but the rounding off isn't even precise - say for example the number is 684.34998734 in the database, I get it using rs.getFloat() as 684.350011.
Can anyone please tell me what the problem might be ?

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 1 2003
Added on Aug 1 2003
2 comments
327 views