I am trying to retrieve STDDEV of a decimal value from Db2 for z/OS table. I use the below SQL.
// Execute a query and generate a ResultSet instance
rs = stmt.executeQuery("SELECT STDDEV(SALARY) FROM DSN8910.EMP"
+ " WHERE WORKDEPT = 'A00' ");
while (rs.next()) {
hStdDev = rs.getBigDecimal(1);
System.out.println("hStdDev " + hStdDev);
}
I get different results in SPUFI and while using JDBC.
Using SPUFI:
+0.9742432961021595E+04
Using JDBC:
9742.432961021594
I tried using getString, getFloat. But all of them yields a same result.
Two questions:
- How can I display it in an exponential form ? Same as SPUFI result.
- The last digit is not rounded off. how can I round off ?