블로그 이름

[Spring] NestedSQLException 에러 본문

개발/오류

[Spring] NestedSQLException 에러

Hide 2024. 1. 25. 19:19

쿼리 조회가 안된다. 

 

문법 예외라고 한다.

 

 org.apache.catalina.core.StandardWrapperValve invoke

SEVERE: 경로 [/blazeds]의 컨텍스트 내의 서블릿 [...Servlet]을(를) 위한 Servlet.service() 호출이, 근본 원인(root cause)과 함께, 예외 [Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: SqlMapClient operation; bad SQL grammar []; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred while applying a parameter map.  
--- Check the 쿼리명-InlineParameterMap.  
--- Check the statement (query failed).  
--- Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'WHERE DATE_FORMAT(IFNULL(licenseDateFrom, NOW()), '%Y%m%d') <= DATE_FORMAT(NO...' at line 1]을(를) 발생시켰습니다.
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'WHERE DATE_FORMAT(IFNULL(licenseDateFrom, NOW()), '%Y%m%d') <= DATE_FORMAT(NO...' at line 1
  at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

 

쿼리 확인해보니 WHERE 절이 두 개 들어가 있었다.

AND로 수정하여 해결했다.