카테고리 없음

220907 스프링 게시판 만들기 시작 3-5 화면입력값null 조치 방법

나이많은 초보 2022. 9. 7. 15:19

Request processing failed; nested exception is org.springframework.jdbc.UncategorizedSQLException: Error setting null for parameter #1 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: 부적합한 열 유형: 1111

출처: https://haenny.tistory.com/22 [Haenny:티스토리]

<!-- 만약에 null 데이터가 전달되었으면 빈칸이 아닌 NULL로 인식하도록 설정 -->

 

jdbcType값을 붙여야하는데 양이 상당히 많아 하나하나 변경이 어려울 경우..

mybaits설정파일에서 재설정해주면 된다...

root // property name이 configL

 

<!-- 만약에 null 데이터가 전달되었으면 빈칸이 아닌 NULL로 인식하도록 설정 즉 db에 있어서 매핑문구에는 있으나 화면에 구성되어 있지않아 값을 받지 않는 경우, 에러내지말고 그냥 null로 쓰도록 해라....-->

요렇게 해주면된다는거.