새로운시작

Value '0000-00-00' can not be represented as java.sql.Date 본문

ERROR

Value '0000-00-00' can not be represented as java.sql.Date

eunnyy 2017. 7. 17. 17:52

Value '0000-00-00' can not be represented as java.sql.Date 에러


1. 원인


select 하려는 테이블에 타입이 date인 컬럼이 있다.

이 컬럼의 데이터값이 0000-00-00(null) 로 들어가있는데, 이걸 select  하려고 하다보니 생기는 에러


2. 해결


jdbc.propertis에


jdbc.url << 이 있다.


jdbc:mysql://localhost/(각자이름)?zeroDateTimeBehavior=convertToNull


진하게 표시되어있는걸 추가해주면 date가 null 이여도 정상적으로 돌아간다.

Comments