Re: Numeric overflow

From: Anthony Borla <ajborla_at_bigpond.com>
Date: Sun, 21 Dec 2003 11:28:45 GMT
Message-ID: <NtfFb.60486$aT.45400_at_news-server.bigpond.net.au>


"DiggidyMack69" <DiggidyMack69_at_hotmail.com> wrote in message news:c86ce4f.0312201836.60dc713a_at_posting.google.com...
>
> Hello folks,
> I have a servlet in a Java web app that accesses an oracle
> table with a column that is NUMBER(12)
>
> When I put an integer into it of 10 digits or larger I get
> a numeric overflow error. I am using the getInt method
> and putting that into a java int variable. Do either of these
> have a max length and if so what should I be using for
> large number??
>

An 'int' can hold values -2^31 through to 2^31 - 1 [i.e. max 10 digits]. A 'long' can hold values -2^63 through to 2^63 - 1 [i.e. 19 max digits].

You make the choice :) !

I hope this helps.

Anthony Borla Received on Sun Dec 21 2003 - 12:28:45 CET

Original text of this message