Re: Numeric overflow
From: Anthony Borla (ajborla_at_bigpond.com)
Date: 12/21/03
- Next message: Anthony Borla: "Re: Real Newbie Question"
- Previous message: Joseph: "newby, which java 4 linux to use?"
- In reply to: DiggidyMack69: "Numeric overflow"
- Next in thread: Amey Samant: "Re: Numeric overflow"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 21 Dec 2003 11:28:45 GMT
"DiggidyMack69" <DiggidyMack69@hotmail.com> wrote in message
news:c86ce4f.0312201836.60dc713a@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
- Next message: Anthony Borla: "Re: Real Newbie Question"
- Previous message: Joseph: "newby, which java 4 linux to use?"
- In reply to: DiggidyMack69: "Numeric overflow"
- Next in thread: Amey Samant: "Re: Numeric overflow"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]