- It because our application is very old and huge also in most of the places we are executing a statement like below,
preparestatement.setDouble(id,5.0) ;
And Oracle stores it as 5(Number data type) and PostgreSQL stores it as 5.0 (which is valid as per definition of numeric data type),
And in application code, to retrieve this id,we have used
String id = resultSet.getString("id");
Later somewhere in code executing below logic,
Integer id = Integer.ValueOf( id ); - This results in NUMBER FORMAT exception if the selected id is like 5.0( because its double in reality ) and works fine if selected id is 5
So, I don't want to change my Insert or any other logic in my application (There are so many such instances), instead if I can find a right way to store 5.0 as 5 for the same numeric type, The problem solves.