Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- C#
- 쿼리
- windows7
- 오라클
- PHP
- 데이터베이스
- 가상머신
- 스프링부트
- db
- 이미지엑박
- springboot
- 다중pk
- 자바스크립트
- memoryDB
- mysql
- ascx.cs
- SQL
- ASP
- 프로그래머스
- HTML
- 다중기본키
- 자동증가열
- 코딩테스트
- VMWare
- javascript
- 트리플DES
- CrossSiteScripting
- mssql
- oracle
- 람다식함수
Archives
- Today
- Total
개발바닥 아방수
[스프링부트] MemoryDB 데이터베이스 설정 본문
스프링부트 데이터베이스 설정을 해보자!
-- 테스트 db 때 사용한다.
- 다음 파일에 해당 내용을 추가해준다.
- \src\main\resources\application.properties
#h2 console 활성화 및 경로 설정
spring.h2.console.enabled=true
spring.h2.console.path=/h2-console
#h2 db 설정
spring.datasource.url=jdbc:h2:~/test;
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect
- build.gradle 파일에서 dependencies에 runtimeOnly 'com.h2database:h2'가 있는지 확인한다.
- 없으면 적어준다.
- localhost:8080/h2-console 에 접속하면 다음과 같은 화면이 뜬다.
- Connect 버튼을 누르면 다음과 같은 화면이 뜬다.
'웹 개발 > Java' 카테고리의 다른 글
[스프링부트] 타임리프 방식으로 form 보내기 (0) | 2022.12.21 |
---|---|
[스프링부트] Controller, RestController, View, DTO 예제 (1) | 2022.12.21 |
[스프링부트] spring boot 환경설정하기 (0) | 2022.12.21 |