how to convert a string to double & insert it in mysql table as bigint(24)
807605Aug 22 2007 — edited Aug 22 2007hi,
i have built a mysql table which has field"messageid" bigint(24),
i want to insert values to this field at runtime..
in my programe there is string messageid="07168383580606200700000"
i parse this value to a double/long but it give numberformat exception.
by configuring the messageid field as varchar(24), this can be done easily.
but when it comes to any form of int type, the converting part gives numberformatexception.
as im involving wit complex process of quering database it is essential to keep the field as int.
double messageid1=0;
try{
messageid1=Double.parseDouble(messageid);
}
catch(NumberFormatException e){
messageiderror(messageid,message," Invalid MessageID");
return 0;
}
now it gives an exception "Data truncated for column 'MessageID' at row 1"
only the catch block is executed. can anyone help me to get rid of this,
thanks in advance
dushi