에러 기록 정리
Cause: java.sql.SQLException: 숫자 오버플로우
정몽실이
2020. 9. 7. 13:46
에러내용:
Error attempting to get column 'FST_SELLPRC' from result set. Cause: java.sql.SQLException: 숫자 오버플로우 ; uncategorized SQLException; SQL state [99999]; error code [17026]; 숫자 오버플로우; nested exception is java.sql.SQLException: 숫자 오버플로우
문제발생이유:
FST_SELLPRC 컬럼에 4900049000 값이 들어있는데 , 이걸 int 로 받아서 숫자 오버플로우 발생
JAVA에서 기본 int형의 범위가
int | 4byte | -2147483648 | 2147483647 |
해결방법:
따라서 저 컬럼을 담는 Dto 변수의 클래스형을 int
-> long
또는 BigDecimal
로 바꿔줘야 한다.