DB2's JDBC driver appears to be truncating the precision of Numeric/Decimal fields. I have the following field defined in a SALES table:
AMOUNT AS DECIMAL(16,16)
I then do the following insert statement:
INSERT INTO SALES (AMOUNT) VALUES(14.12345678)
If I query using the query facility in DB2 Control Center, I get 14.1234567800000000.
If I do it using Squirrel (a DB client that uses DB2's JDBC driver to connect to the database, I am getting 14.12346. The same happens when I do the same from Java code using Hibernate.
This leads me to believe that the JDBC driver is truncating precision of the result. Is there any way to configure the JDBC driver with options to prevent this? I've seen the the JDBC options for the JDBC driver but none seem to describe one that affects this.
DECIMAL(16,16)is a bit weird, a 14.1234567890123456 doesn't fit (that at minimum a would be aDECIMAL(18,16)). - Mark Rotteveel