By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,558 Members | 1,210 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,558 IT Pros & Developers. It's quick & easy.

Numeric overflow

P: n/a
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??

thanks in advance,
DM
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"DiggidyMack69" <Di***********@hotmail.com> wrote in message
news:c8*************************@posting.google.co m...

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
Jul 17 '05 #2

P: n/a
hi
Java has great support for this
i was writing an application that simulates RSA algorithm (of course
it was for educational purpose ;) not practical use ) .....
but i found a good support for real largeeeeeeeeeeeeeeee integers
check out java.math.BigInteger class
it should suffice your needs ...

cheers
amey

Di***********@hotmail.com (DiggidyMack69) wrote in message news:<c8*************************@posting.google.c om>...
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??

thanks in advance,
DM

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.