I have a prepared statement. I call
stmt.setBigDecimal(BigDecimal.valueOf("0.9"))
the problem is that in the database 0.90000000000000000000 is saved instead of 0.9.
I use Microsoft SQL Server JDBC Driver 3.0.
Is BigDecimal not understood by the driver or make the driver do something wrong?
As you indicate that the datatype is DECIMAL(36,20), it is totally logical: 36,20 means: 36 numbers precision, of which there are 20 after the decimal separator.
If you save 0.9 in DECIMAL(36,20), it will be 0.90000000000000000000 (which has 20 positions after the decimal separator) as that is the specified precision for the field.