The difference must be due to the JVM. Adding the zeros after the decimal point is the correct behavior. The JDBC driver uses the BigDecimal.toPlainString() method to convert to String when the ResultSet.getString(column) method is called. If you don't want trailing zeros, then the code to access the data should call ResultSet.getBigDecimal(column). Then the BigDecimal.stripTrailingZeros() method can be used to remove the trailing zeros.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Diff:
The data type is Decimal(8,2) so it will always display the 2 digits after the decimal point.
Sorry, but this cannot be true by default:
We have two different AS400 / System i installations.
Here it works:
Here it wont work:
(I checked them - they are identically)
What Java (JVM) version are you using for the two cases?
Not Working: JRE 1.8.0_192-b12
Working: JRE 1.8.0_131-b11
The difference must be due to the JVM. Adding the zeros after the decimal point is the correct behavior. The JDBC driver uses the BigDecimal.toPlainString() method to convert to String when the ResultSet.getString(column) method is called. If you don't want trailing zeros, then the code to access the data should call ResultSet.getBigDecimal(column). Then the BigDecimal.stripTrailingZeros() method can be used to remove the trailing zeros.
You can close the Ticket. I found a different Option in our SQL-Tool which was not set correctly.