This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I wrote a Java app to move lat,lon data from an Oracle table to a Postgres table. The app reads an Oracle row and uses the values to build an insert statement that is executed against the Postgres table. Both columns in both tables are defined as numeric.
The java code that replaces the prepared statement placeholder with an actual value is:
When I run the application values are truncated to 12 decimal digits, for example
113.26666666666667 value shown by System.out.println(rs.getDouble(columnIndex));
113.266666666667 value shown by select * from test_moveit_truncation after the move application was run
If I capture the prepared statement with System.out.println(stmt.toString()) I see an untruncated value in the statement
INSERT INTO test_moveit.test_moveit_truncation (lat,lon) VALUES (-7.766666666666667,113.26666666666667)
If I run this statement using the Postgres admin console the values are inserted without truncation.
I can't tell whats going on here, can anyone make sense of these results and figure out where the truncation is happening?