방명록
- [mac] h2 데이터베이스2024년 03월 12일 16시 03분 16초에 업로드 된 글입니다.작성자: 민발자728x90
H2 Database
자바로 작성된 관계형 데이터베이스 관리 시스템으로 로컬환경에서 테스트나 개발을 위해 간편하게 사용
특징
인 메모리 DB로 메모리에 데이터가 저장되고 애플리케이션이 종료되면 모든 메모리는 삭제된다.
별도의 설치가 필요 없고 작은 용량과 매우 가볍고 빠르기 때문에 개발 단계나 테스트 코드에서 자주 사용된다.
RDBMS보단 안정성이나 성능에서는 떨어지기 때문에 대규모 프로젝트에서는 적합하지 않다.
다운로드
https://h2database.com/html/main.html
H2 Database Engine
H2 Database Engine Welcome to H2, the Java SQL database. The main features of H2 are: Very fast, open source, JDBC API Embedded and server modes; in-memory databases Browser based Console application Small footprint: around 2.5 MB jar file size Supp
h2database.com
All Platforms 다운로드 실행
압축해제 압축을 풀어주고 원하는 폴더에 이동
// 폴더로 이동 cd Documents/h2/bin // 실행 ./h2.sh //permission Error 발생시 권한 부여 chmod 755 h2.sh
사용법
데이터베이스 생성
h2 콘솔창 jdbc:h2:~/testDB
사용자/사용자명 폴더에 생성 터미널에서 실행 해주면 콘솔창이 뜨고 연결해 주면 데이터베이스가 생성된다.
데이터베이스 접속
jdbc:h2:tcp://localhost/~/testDB
데이터베이스 생성 이후엔 localhost로 접속!
JDBC 연결
build.gradle 라이브러리 추가
implementation 'org.springframework.boot:spring-boot-starter-jdbc' runtimeOnly 'com.h2database:h2'
properties 연결 설정 추가
spring.datasource.url=jdbc:h2:tcp://localhost/~/testDB spring.datasource.driver-class-name=org.h2.Driver spring.datasource.username=sa
728x90'참고 > Mac' 카테고리의 다른 글
[mac] mysql 실행(DBeaver Public Key Retrieval is not allowed 오류) (0) 2024.03.07 [M1] Oracle Database 설치 (0) 2024.01.26 [Mac] 맥북 인텔리제이 생성자, getter/setter 자동 생성 단축키 (0) 2023.08.06 [Mac] 맥북 Operation not permitted 해결 (0) 2023.08.06 [Mac] 자바 버전 변경하기 (0) 2023.07.31 다음글이 없습니다.이전글이 없습니다.댓글