mybatisプロジェクトレポートjava.sql.SQLException:数値オーバーフロー例外



Mybatis Project Report Java



転送元: http://www.easytd.com/yichangjijin/d_1411081846.html

プロジェクトレポートjava.sql.SQLException:異常な数値オーバーフロー、データベースoracle、使用されるmybatis例外情報は次のとおりです。



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

以下の情報をご覧ください。

http://www.coderanch.com/t/610303/JDBC/databases/SQL-state-error-code-Numeric 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.

つまり、oracleの数値はjavaのlong型よりも大きい可能性があるため、BigIntegerまたはBigDecimalを使用することをお勧めします。



In my current project, the short type is used in the project, and the data in the database has reached more than 37,000, so it overflowed. The solution is to change the data type in java.