일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- tomcat9
- 지도 이미지
- 배열 최대 최소
- 백준 문자
- 넥사크로
- 자바
- 백준10171
- 2739 구구단
- 문자 9086
- allowMultiQueries
- 백준
- 백준10172
- Gabia
- nexacro
- 9498 시험성적
- 10172 개
- 백준 25314
- 톰캣9
- 배열 최대값 최소값
- 25304 영수증
- update 오류
- 8393 합
- 2753 윤년
- 자바 최대 최소
- 1330 두 수 비교하기
- 백준 영수증
- 백준 개수 세기
- 백준 9086
- mybatis update 오류
- 백준 사분면
- Today
- Total
두두의 메모
[mybatis 오류] List<?> 다중 update에서 오류 발생 본문
[ 직면한 오류 ]
WARN 68124 --- [nio-9797-exec-5] o.m.jdbc.message.server.ErrorPacket : Error: 1064-42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UPDATE AAAERROR 68124 --- [nio-9797-exec-5] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException:
[ 원인 ]
List<VO> list를 update문의 parameterType으로 받고, 연속 업데이트를 하고 싶었다.
그런데 separator, begin 등을 바꿔도... 아무리 봐도 문법이 맞는데 계속 위와 같은 오류가 발생했다.
HeidiSQL에도 잘만 돌아가는 쿼리문인데 오류가 뜬다. 이러면 spring-mybatis쪽에 이상이 있다고 판단이 들었고 열심히 구글링을 했다.
[ 해결 ]
https://okky.kr/questions/450866
이 분과 동일한 상황이었는데
해결방법은 properties파일에 spring.datasource.url이 있을 것이다.
여기 맨 뒤에 [?allowMultiQueries=true]를 붙이면 해결됐다.
spring.datasource.url=jdbc:mariadb://xxx.xxx.xx.xxx:3306/db_name?allowMultiQueries=true
'spring' 카테고리의 다른 글
목록 페이지 작업과 includes하기 (0) | 2022.03.28 |
---|---|
Github에 이클립스 프로젝트 올리기 (0) | 2022.03.27 |
log4jdbc-log4j2설정 (코드로 배우는 스프링 웹 프로젝트) (0) | 2022.03.13 |
MyBatis와 스프링 연동하기(코드로 배우는 스프링 웹 프로젝트) (0) | 2022.03.13 |
eclipse에 스프링 플러그인 설치 (0) | 2022.03.07 |