inflearn logo
강의

Course

Instructor

[Revised 2023-11-27] Developing RESTful Web Services using Spring Boot 3.x

Adding Dependency and Entity Setting for JPA

JDBC URL

629

haguri

2 asked

21

spring:

...

datasource:
url: jdbc:h2:mem:testdb
jpa:
show-sql: true
h2:
console:
enabled: true

위 처럼 datasource 부분을 추가해줘야

/h2-console 에서 정상적으로 Connect 됩니다.

rest-api spring-boot

Answer 4

3

Dowon Lee

안녕하세요, 이도원입니다. 

답변이 늦어 죄송합니다. 

스프링부트에서는 내부적으로 아래와 같은 정보를 자동으로 생성합니다. 

  • Driver Class : org.h2.Driver
  • JDBC URL : jdbc:h2:mem:testdb
  • Username : sa
  • Password :

그러나, 접속 시

Database "mem:testdb" not found, either pre-create it or allow remote database creation (not recommended in secure environments)

위와 같은 오류가 발생한다면, h2의 버전을 낮춰서(1.3.x 또는 1.4.197 이하) 사용하시기 바랍니다. 최신 h2 버전에서는 데이터베이스를 미리 생성하는 것을 방지하도록 설정 되어 있습 니다. (https://github.com/h2database/h2database/issues/1901)

감사합니다.

0

cc2

감사합니다

 

0

xxoals1021

감사합니다~

0

lon

감사합니다 하구리님 

JPA

0

59

1

jpa dependency를 추가하고 SecurityConfig클래스에서 오류가 납니다.

0

68

1

웹 브라우저 400 bad request

0

72

1

@Size는 되는데 @Past는 안 됩니다.

0

61

1

pdf 자료는 없나요?

0

73

2

locale 정보가 null 이면 무조건 messages_ko.properties이 호출 되는 문제

0

88

2

Swagger 강의, Unable to infer base url 이거 뜨시는 분들 도움되시라고

0

119

1

강의에서나온 화면 피피티

0

159

1

HelloWorldBean 관련 에러

0

184

2

Swagger API 3.x 오류..

0

219

1

java: variable message not initialized in the default constructor 에러는 어찌하면 좋을까요?

1

282

1

현재 GIT에 올리신 소스를 실행해봤습니다.

0

189

2

고양이 소리가 귀엽네요 !!

0

137

2

git에서 소스받고 실습중인데

0

117

1

post가 안되요

0

102

1

한국어 같은 경우 언어코드인 messages_ko.properties 로 생성하는게 더 좋지 않나요?

0

168

2

리턴타입으로서 EntityModel<User> 와 ResponseEntity질문

0

104

1

예외처리쪽 관련 질문있습니다.

0

159

2

엔티티가 바로 응답으로 나가도 되나요??

0

222

2

안녕하세여 Cannot invoke "co.kr.joneconsulting.resfulservice.repository.PostRepository.save(Object)" because "this.postRepository" is null

0

137

2

사용자 등록하고 나서 H2 에서 보면 신규 사용자의 password, ssn 이 null 로 되어 있습니다.

0

140

2

ApplictionContext 질문

0

192

2

롬북이 안먹히는것같아요

0

156

1

인텔리제이에서스프링부트 파일 실행하면

0

240

1