private String safeDoubleToString(Double number){
  if (number.isNaN()) {
    return "NULL";
  }
  String orig=number.toString();
  int pos=orig.indexOf('E');
  if ((pos == -1) || (orig.charAt(pos + 1) == '-')) {
    return orig;
  }
 else {
    StringBuffer buff=new StringBuffer(orig);
    buff.insert(pos + 1,'+');
    return new String(buff);
  }
}

private String safeDoubleToString ( Double number ) { if ( number . isNaN ( ) ) { return "NULL" ; } String orig = number . toString ( ) ; int pos = orig . indexOf ( 'E' ) ; if ( ( pos == - 1 ) || ( orig . charAt ( pos + 1 ) == '-' ) ) { return orig ; } else { StringBuffer buff = new StringBuffer ( orig ) ; buff . insert ( pos + 1 , '+' ) ; return new String ( buff ) ; } }
inserts a + if the double is in scientific notation . mysql doesn ' t understand the number otherwise .
