기록해! 정리해!

JPA 스타트 (테이블 생성 후 오라클에서 확인하기) 본문

SpringBoot

JPA 스타트 (테이블 생성 후 오라클에서 확인하기)

zsuling 2022. 10. 17. 18:04

 

1. 프로젝트생성

2. application.properties

 

# 주석 ( none , servlet )
spring.main.web-application-type=servlet
server.port=8888

# 오라클 컨넥션 정보
spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver
spring.datasource.url =jdbc:oracle:thin:@localhost:1521:xe
spring.datasource.username=system
spring.datasource.password=1234

## JPA  Setting
spring.jpa.hibernate.ddl-auto=update
spring.jpa.generate-ddl=false
spring.jpa.show-sql=true
spring.jpa.database-platform=org.hibernate.dialect.OracleDialect
spring.jpa.properties.hibernate.format_sql=true


# JSP 경로 설정
# spring.mvc.view.prefix=/WEB-INF/view/
# spring.mvc.view.suffix=.jsp


####  다중 mapper 설정하기
# mybatis.mapper-locations=classpath:mapper/**/*.xml


#thymeleaf cache setting
spring.thymeleaf.cache=false

 

3. Board

package com.rubypaper.board;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import lombok.Data;

@Data
@Entity
@Table(name="Board1017")
public class Board {

	@Id
	@GeneratedValue
	private Long seq;
	private String title;
	
}

4. 실행 시 콘솔창에 테이블 생성된 것을 확인할 수 있다

>> 오라클에서 확인해보기

'SpringBoot' 카테고리의 다른 글

JPA - Board(Junit-1)  (0) 2022.10.17
JPAJarTymeleaf - Board  (0) 2022.10.17
Thymeleaf - maven install  (0) 2022.10.17
Tymeleaf 구조알기  (0) 2022.10.17
thymeleaf - hello (연산, 문자열, 반복문,if)  (0) 2022.10.14
Comments