Problem with getDouble()

Joe Sam Shirah

First, let me assure you that something has changed, whether driver, database column definition, or database update. Even so, you were just lucky in the past. Some numbers can't be properly represented in binary and using floats/doubles for fixed decimal values is a classic trap for programmers.

While it doesn't help much at this point, it does highlight the value of proper planning for database definition and manipulation. The column should be defined as NUMERIC or DECIMAL, with the expected scale ( decimal point digits ) and get/setBigDecimal() should be used for retrieval and update.