728x90
300x250
springboot 입문자에겐 멀고도 험한길 ...
여튼 테이블을 자동 생성해준다해서 해보는데 계속 MySQLException 이 뜨고 뻘건 에러문구만 나서 찾고 찾다가 해결
열받네 ..
VO는 잘만들어졌다는 가정하에 ..
Member
package com.bug41.sample.model;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
import java.util.Date;
@RequiredArgsConstructor
@Getter
@Setter
@Entity
@Table(name = "member")
@DynamicInsert
@DynamicUpdate
public class Member {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer no;
@Column(name = "id")
private String id;
@Column(name = "password")
private String password;
@Column(name = "name")
private String name;
@Column(name = "email")
private String email;
@Column(name = "phone")
private String phone;
@Column(name = "discd")
private String discd;
@Column(name = "created_at")
private Date created_at;
@Column(name = "updated_at")
private Date updated_at;
}
application.properties
#spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQLInnoDBDialect
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto=update
# DB접속을 위한 설정값
spring.datasource.url=jdbc:mysql://서버IP:포트번호/DB명?useSSL=false&serverTimezone=UTC&zeroDateTimeBehavior=convertToNull
spring.datasource.sql-script-encoding=UTF-8
spring.datasource.username=유저ID
spring.datasource.password=비밀번호
spring.jpa.properties.hibernate.dialect.storage_engine=innodb
#jpa에서 실행되는 쿼리문을 볼 수 있게하는 설정값
spring.jpa.properties.hibernate.show_sql=true
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
logging.level.org.hibernate.type.descriptor.sql=trace
#spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQLInnoDBDialect
요놈으로 계속 하고있다가 MySQL5Dialect 로 바꿔주니까 잘되는것을 확인하였다.
728x90
300x250
'IT > JAVA' 카테고리의 다른 글
[Tomcat] 톰캣 권한 , systemctl, appBase 설정 (0) | 2021.08.26 |
---|---|
[Spring Boot] 프로젝트 불러왔을때 오류 해결방법 Gradle Refresh (0) | 2021.08.23 |
[java] send mail:javax.mail.MessagingException: Could not convert socket to TLS; (1) | 2021.08.18 |
Springboot Gradle Execution failed for task ':compileJava'. (0) | 2021.07.23 |
SpringBoot (Gradle Project) 에서 React 사용하기 (1) (4) | 2021.07.23 |