tags:

views:

55

answers:

1

We have currently a wsdl element that was defined as long since the number that was being passed could have a maximun value of 2^64.But now the client wants to pass in numbers with maximum values of 2^256 .In my view the only way to support this is to change the xsd type to String.Anybody has a better idea about dealing with it .

Also the java code needs to handle this and persist it to the DB. There also i see no alternative but to use String object. Am i thinking rightly?

+3  A: 

What does the value represent ? What do you actually do with it ? What level of accuracy do you require it to be held at ?

While Oracle won't complain about being given a very large number, it only stores up to a precision/scale of 38. Since power(2,256) is about 1.15E+77, an Oracle number won't necessarily preserve that accurately.

Assuming it does need to be retained accurately (eg some sort of cryptographic key), I'd go with a string.

Gary
take in consideration size of String comparing to binary size of Number, this can count in high load, or using in devices with slow internet connections (2G GSM networks for instance)..
ante.sabo
True. In some circumstances you may be able to use a hash of the full value
Gary
thanks! Gary for your answerYou are spot on with the oracle bit too..Oracle will store pretty much store any number but the precision will be limited to 38 ..So i guess ill have to change the column to a VARCHAR..since this is a crypto graphic key and needs to be retained accurately
neverland