1

Hi I am getting the bwlow error while running my JAVA code

Caused by: java.sql.SQLException: Numeric Overflow
at oracle.jdbc.driver.NumberCommonAccessor.throwOverflow(NumberCommonAccessor.java:4380) ~[ojdbc-11.2.0.2.0.jar:11.2.0.2.0]
at oracle.jdbc.driver.NumberCommonAccessor.getInt(NumberCommonAccessor.java:111) ~[ojdbc-11.2.0.2.0.jar:11.2.0.2.0]
at oracle.jdbc.driver.NumberCommonAccessor.getObject(NumberCommonAccessor.java:3263) ~[ojdbc-11.2.0.2.0.jar:11.2.0.2.0]
at oracle.jdbc.driver.T4CVarnumAccessor.getObject(T4CVarnumAccessor.java:303) ~[ojdbc-11.2.0.2.0.jar:11.2.0.2.0]
at oracle.jdbc.driver.OracleCallableStatement.getObject(OracleCallableStatement.java:2049) ~[ojdbc-11.2.0.2.0.jar:11.2.0.2.0]
at oracle.jdbc.driver.OracleCallableStatementWrapper.getObject(OracleCallableStatementWrapper.java:815) ~[ojdbc-11.2.0.2.0.jar:11.2.0.2.0]
3
  • 1
    Looks like you number is to big for an int. Use a Long instead Commented Oct 9, 2017 at 9:16
  • please post your code Commented Oct 9, 2017 at 10:29
  • 1
    Thanks for suggestions. Already using Long in the outputMapper. The DB column is Number(18), the generated number by the store proc is of the 13 digits. Up to 12 digits its working, but when stored proc startd producing 13 digit number the code is failing. Commented Oct 9, 2017 at 12:39

2 Answers 2

7

In Oracle, if you store numeric data and this data is out of range from column data type then you got this type of Exception.

Example- if you have a column of INTEGER(NUMBER) type and you store data greater than 2,147,483,647 then its Numeric Overflow.

Sign up to request clarification or add additional context in comments.

1 Comment

The column data type is NUMBER(18) , while the generated number is of 13 digits.Can you please suggest ?
1

I have the same problem. I use " Types.BIGINT" instead of "Types.NUMERIC" in java code. and the problem solved

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.