본문 바로가기
Spring

[spring] Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException 오류 해결하기

by happenstance 2021. 12. 7.

컨트롤러에서 쿼리문이 잘 짜여졌나 테스트를 하는 과정에서 오류가 발생했다.


심각: 경로 []의 컨텍스트 내의 서블릿 [appServlet]을(를) 위한 Servlet.service() 호출이, 근본 원인(root cause)과 함께, 예외 [Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: 
### Error updating database.  Cause: java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended

### The error may exist in file [C:\dalmuti\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\dalmuti\WEB-INF\classes\sqlMap\sanctionMapper_SQL.xml]
### The error may involve kr.or.ddit.sanction.mapper.SanctionMapper.tmprModify-Inline
### The error occurred while setting parameters
### SQL: UPDATE SANCTN_TMPR   SET DOC_SJ = ?,       DOC_CN = ?       STRE_DE = SYSDATE   WHERE TMPR_STRE_SN = ?    AND EMP_NO = ?
### Cause: java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended

; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended
]을(를) 발생시켰습니다.
java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended


검색해보니 쿼리문에 세미콜론을 썼다던가, 콤마가 빠졌다던가, 매퍼랑 id가 다르다던가 ,,

그런 문제였는데 나는 아니었다

 

DB에서 실행해보고 가져온거라 매퍼 컨트롤러 xml만 뒤지다가 설마하고

DB에서 실행해봤는데 오류가 났다 ㅠ 

막막했는데 다행이었음 .. DB에서 실행 잘 됐으면 계속 뭔지 찾아봐야 했을텐데

 

암튼 오류 원인은 컬럼명이 달랐음 .. 당연히 안되지 .. 휴

이런 실수는 그만 ㅠ ㅠ ㅠ 실수도 실력 ,,