본문 바로가기

Java/MyBatis

[MyBatis] XML 세미콜론 포함 시 SQLSyntaxErrorException

Datagrip에서 동일 쿼리문 수행했을 때 정상 작동하나, Server에서 MyBatis를 통해 반환하는 값은 아래와 같았다.

### Error querying database.  Cause: java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended

### The error may exist in URL [jar:file:/{.xml_파일_절대경로}]
### The error may involve {mapper_패키지_경로.mapper_쿼리_id명}-Inline
### The error occurred while setting parameters
### SQL: {오류 대상 쿼리문, (parameter 위치의 경우 ? 로 기재됨)};
### Cause: java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended

; bad SQL grammar []

MyBatis에서 수행 시, 세미콜론은 제외해주도록 하자.