Numeric overflow

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • DiggidyMack69

    Numeric overflow

    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
  • Anthony Borla

    #2
    Re: Numeric overflow


    "DiggidyMac k69" <DiggidyMack69@ hotmail.com> wrote in message
    news:c86ce4f.03 12201836.60dc71 [email protected] le.com...[color=blue]
    >
    > 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??
    >[/color]

    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


    Comment

    • Amey Samant

      #3
      Re: Numeric overflow

      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 largeeeeeeeeeee eeeee integers
      check out java.math.BigIn teger class
      it should suffice your needs ...

      cheers
      amey

      DiggidyMack69@h otmail.com (DiggidyMack69) wrote in message news:<c86ce4f.0 312201836.60dc7 [email protected] gle.com>...[color=blue]
      > 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[/color]

      Comment

      Working...