이번에 작성할 코드는 application.properties 파일입니다.
이 파일은 프로젝트의 환경 설정을 담당하는 핵심 설정 파일입니다.
파일 위치:
src/main/resources/application.properties
아래의 코드를 추가합니다.
▼ Code
spring.application.name=member spring.datasource.url=jdbc:oracle:thin:@localhost:1521:xe spring.datasource.username=spring spring.datasource.password=1234 spring.datasource.driver-class-name=oracle.jdbc.OracleDriver spring.jpa.hibernate.ddl-auto=none spring.jpa.show-sql=true spring.jpa.properties.hibernate.format_sql=true server.port=80 server.error.whitelabel.enabled=false logging.level.web=info spring.thymeleaf.cache=false
▼ Explain
spring.application.name=member 현재 프로젝트의 이름을 member로 지정합니다. spring.datasource.url=jdbc:oracle:thin:@localhost:1521:xe Oracle DB 접속 URL입니다. 로컬호스트 1521 포트의 SID "xe"로 접속합니다. spring.datasource.username=spring DB 사용자 이름입니다. spring.datasource.password=1234 DB 비밀번호입니다. spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver JDBC 드라이버 클래스 이름입니다. spring.jpa.hibernate.ddl-auto=none JPA에서 테이블을 자동 생성하거나 변경하지 않도록 합니다. 가능한 값의 예시는 create, create-drop, update, validate, none이 있습니다. spring.jpa.show-sql=true 실행되는 SQL을 콘솔에 출력합니다. spring.jpa.properties.hibernate.format_sql=true SQL을 보기 좋게 줄바꿈과 들여쓰기로 출력합니다. server.port=80 STS에 내장된 톰캣의 포트 번호를 80으로 설정합니다. server.error.whitelabel.enabled=false Spring Boot 기본 에러 페이지를 끕니다. logging.level.web=info Spring Boot의 web 로깅 레벨을 INFO로 낮추어서 자세히 출력합니다. spring.thymeleaf.cache=false Thymeleaf 템플릿 캐시를 끕니다. 개발 중 html 템플릿이 수정되면 새로고침 없이 즉시 반영됩니다.
개인정보처리방침 · 이용약관