환경 : 인텔리인텔리제이 , gradle , jpa , mariadb, spring boot
could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet
spring boot에서 개발 도중 위 와 같은 이슈 발생
1. application.yml 파일에서 아래와 같이 사용 중이었습니다.
spring:
datasource:
url: jdbc:mariadb://127.0.0.1:3306/local?characterEncoding=UTF-8&serverTimezone=UTC
2. build.gradle 사용 중 내용
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-devtools'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'mysql:mysql-connector-java'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation("org.junit.vintage:junit-vintage-engine") {
exclude group: "org.hamcrest", module: "hamcrest-core"
}
이렇게 사용했을 때의 이슈가 났기 때문에 mariadb 연결 방식을 변경
1. application.yml
spring:
datasource:
url: jdbc:mysql://127.0.0.1:3306/local?characterEncoding=UTF-8&serverTimezone=UTC
2. build.gradle
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-devtools'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'mysql:mysql-connector-java'
// runtimeOnly 'org.mariadb.jdbc:mariadb-java-client'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation("org.junit.vintage:junit-vintage-engine") {
exclude group: "org.hamcrest", module: "hamcrest-core"
}
일단 문제는 해결되었습니다. 왜 mariadb는 안되고 mysql 변경을 하였을 때 되었는지는 이유를 알 수 없습니다.
선배님들이 댓글로 알려주시면 감사하겠습니다.
'개발 > JPA' 카테고리의 다른 글
jpa QueryDSL Dialect 설정 (0) | 2022.08.16 |
---|---|
queryDSL 중복 데이터 하나만 남기고 제거 (0) | 2022.07.26 |
JPA 생성자 DI 리팩토링 (0) | 2021.02.16 |
EntityManager (0) | 2021.02.12 |
spring boot & JPA & mysql(mariadb) 세팅 및 연동 (0) | 2021.01.21 |