could not execute statement; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute statement
Spring에서 JpaRespository를 이용하여 SQL을 사용할 때 발생하는 에러를 처리하는 방법을 알아보겠습니다.
오류 내용
- o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 1146, SQLState: 42S02
- o.h.engine.jdbc.spi.SqlExceptionHelper : Table 'project.diary' doesn't exist
- could not execute statement; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute statement] with root cause
오류 처리 방안
- DB 테이블에 연결된 column과 IDE에서 선언한 객체들의 이름이 같은지 파악해야한다.
- IDE에서 @Entity로 생성했지만, DB 테이블을 생성하지 않은 경우 발생하기에, SQL 에서 생성이 되어있는지 파악해야한다.
반응형
'Spring > Issue' 카테고리의 다른 글
[오류 처리] Failed to load ApplicationContext (0) | 2023.11.09 |
---|---|
[오류 처리] Content type 'text/plain;charset=UTF-8' not supported (0) | 2023.10.24 |
[오류 처리] No creators, like default construct, exist (0) | 2023.10.17 |
댓글