| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
- chartjs
- mysql
- json
- ES6
- Bootstrap
- AWS Route53
- 인생이재밌다
- mongodb
- MySQL Error
- spread operator
- html
- spring
- Kubernetes
- javascript
- ssh
- AWS
- 예매로직
- sessionStorage
- 영화예매
- Get
- jsp
- ajax
- node.js
- topologySpreadConstraints
- git
- Java
- post
- AWS RDS
- terminationGracePeriodSeconds
- zombie-hit apartment
- Today
- Total
jongviet
June 8, 2021 - date type으로 넘긴 데이터 본문
*6월8일
-request를 타고 date type 형태로 넘어간 viewDate가 mapper에서 자꾸 인식되지 않는 에러가 나타났다. request를 태웠으면 분명히 string일 것이고, ctrl 단에서도 string으로 데이터를 받아서 service -> DAO -> Mapper로 넘겼는데, 하기와같이 SQL문은 잘 전달된 것 같은데 자꾸 리턴 값이 출력되지 않았다.
==> Preparing: select distinct seatNum from schedule s inner join seat s2 on s.moviNum = s2.moviNum where s.viewDate = 2021-06-16 and s.viewTime = 2 and s.moviNum = 3004 and s2.usable_seat = "N";
==> Parameters:
==> Total: 0
-MySQL에서 타이핑해보니 Truncated incorrect DOUBLE value: '2021-06-16' 라는 에러문구가 뜬다. 현재 viewDate가 column에 varchar 형태로 잡혀있는데 날짜 형태로 전달되어서 인식을 못한 것으로 보인다.
-하단과 같이 ""로 감싸주니 DB에서 잘 작동하였고, mapper 파일에도 같은 조치를 하니 잘 작동하는 모습이다.
select distinct * from schedule s inner join seat s2 on s.moviNum = s2.moviNum where s.viewDate ="2021-06-16"
and s.viewTime = 2 and s.moviNum = 3004 and s2.usable_seat = "N";
<select id="seatStatus" parameterType="scd_vo" resultType="map">
select distinct seatNum from schedule s inner join seat s2
on s.moviNum = s2.moviNum where s.viewDate = "${viewDate}"
and s.viewTime = ${viewTime} and s.moviNum = ${moviNum} and s2.usable_seat = "N";
</select>
==> Preparing: select distinct seatNum from schedule s inner join seat s2 on s.moviNum = s2.moviNum where s.viewDate = "2021-06-16" and s.viewTime = 2 and s.moviNum = 3004 and s2.usable_seat = "N";
Parameters: Columns: seatNum
==> Row: 1
==> Row: 3
==> Row: 22
==> Row: 23
==> Total: 4
-앞으로 date type으로 input을 받을 때는 이 부분 꼭 주의하도록 해야겠다.
'movieRsvPjt(JSP, Servlet)' 카테고리의 다른 글
| June 14, 2021 - 기 예약 정보 임시 유지(sessionStorage) (1) | 2021.06.14 |
|---|---|
| June 6, 2021 - 특정일,특정시간대에 맞는 좌석 현황 구현(예매 로직) (0) | 2021.06.09 |
| June 6, 2021 - 갑자기 class not found Exception!?! (0) | 2021.06.07 |
| June 6, 2021 - member table 및 MVC2 pattern 설계 (0) | 2021.06.07 |
| June 3, 2021 - JSP를 베이스로한 첫 팀프로젝트! (0) | 2021.06.03 |