• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQL state [99999]; error code [17026]; Numeric Overflow; nested exception is java.sql.SQLException:

 
selva raja
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear team,

We are getting below exception in java,

SQL state [99999]; error code [17026]; Numeric Overflow; nested exception is java.sql.SQLException: Numeric Overflow
java.sql.SQLException: Numeric Overflow
at oracle.jdbc.driver.NumberCommonAccessor.throwOverflow(NumberCommonAccessor.java:4380)
at oracle.jdbc.driver.NumberCommonAccessor.getInt(NumberCommonAccessor.java:214)
at oracle.jdbc.driver.OracleResultSetImpl.getInt(OracleResultSetImpl.java:896)
at oracle.jdbc.driver.OracleResultSet.getInt(OracleResultSet.java:434)
at org.apache.commons.dbcp.DelegatingResultSet.getInt(DelegatingResultSet.java:236)

Thanks,
selva
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is just a guess, but it looks like you're trying to fetch a value from a ResultSet which doesn't fit into the chosen type in Java. Oracle can store numbers with up to 38 digits (disregarding the scale for now), which far exceeds even the range of Java's long datatype. Inspect the values you're trying to select from Oracle to see whether they don't contain some really large values.

You might try to fetch the number as double instead. If you need to keep the precision, another option might be to select the number as a text (using Oracle's to_char function) and creating a BigInteger or BigDecimal from its textual representation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic