DB
mybatis 쿼리문 작성시 유의사항 - 계속정리할것
쑤기c
2016. 12. 29. 11:41
(2016/12/25)
- update문 수행시 NumberFormatException: for input string : "Y" 라는 에러 발생
원인:) <if test="useYn== 'Y'"> 와 같은 비교문에서 'Y'(싱글따옴표)는 char타입으로 인식하므로 string으로 변경해줘야한다.
처리:) <if test="useYn== 'Y'.toString()"> 으로 변경.
정보:) http://t-ara72.blogspot.kr/2013/10/mybatis-numberformatexception.html
(2017/02/17)
- myBatis XML내부 keyword
[[<!CDATA .... >]]
html태그로 인식되는 <>(부등호) 는 <> 로 변경할 것 (외우기: "xx해요~ lg~♬")
- 숫자 0을 if test하면 0 == '' 조건에 걸린다. -> "".equals(0) 식으로 체크할 것
참고:) http://cofs.tistory.com/97
반응형