Use prepareStatement.setNull(Types.INTEGER) instead of setInt to set it to null.

Can you do the same for scale and precision of that's not the case already?