inflearn logo
강의

Course

Instructor

[Concepts are easy, Practice is intense] Spring Boot, Introduction!

15강 DB연결

Resolved

341

pododo [DEL] 250325223720

0 asked

0

안녕하세요 홍팍님

강의 다시 듣고 있습니다 ㅎㅎ

우선 교재 출간 축하드립니다.

본론으로 들어가면,

DB연결에서 resources 아래 data.sql을 만들고 insert문을 통해 더미들을 생성하는 부분에서 에러가 발생합니다.

Caused by: org.springframework.jdbc.datasource.init.ScriptStatementFailedException: Failed to execute SQL script statement #1 of URL [file:/C:/Users/tttzk/Desktop/firstproject/firstproject/out/production/resources/data.sql]: INSERT INTO article(id, title, content) values (1, 'dummy1', '1111'); nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "ARTICLE" not found (this database is empty); SQL statement:
INSERT INTO article(id, title, content) values (1, 'dummy1', '1111') [42104-214]

data.sql 파일 삭제 후 h2를 보면 article테이블은 생성되는데,

data.sql파일 작성 후 서버를 작동하면

Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "ARTICLE" not found (this database is empty); SQL statement:
INSERT INTO article(id, title, content) values (1, 'dummy1', '1111') [42104-214]

위와 같이 에러가 발생하면서

Process finished with exit code 1

이렇게 띡 하고 끝납니다.

구글링 했을 때는 저와 다른 사례가 나오는 게 많아서 해결이 안됩니다.

도와주십셔

 

spring-boot

Answer 1

0

hongpark

스프링 부트 버전과
운영체제 정보를 알려주시면 확인해보겠습니다

0

pododo [DEL] 250325223720

얼추 해결했슴다ㅎㅎ

23강 댓글 생성 메소드 오류

0

82

2

15.14 강 에러 문제 질문

0

54

1

21강 자율 과제중 update

0

116

2

28강 DB mysql연동 관련 질문

0

279

1

27강 관련 질문

0

198

1

22강 관련질문

0

305

2

21강 create테스트 질문

0

357

1

9강 질문 있습니다

0

277

1

로그창에 내용이 출력이 안됩니다.

0

366

1

index()함수 질문있습니다.

0

358

3

수정완료를 눌렀을때 첫번째 데이터는 전송이 안되고 다시 수정완료 버튼을 눌러야 데이터가 전송 됩니다.

0

471

1

강의와 책 질문

0

433

1

20강 질문있습니다.

0

397

1

20강에서 Article create 부분

0

287

1

16강 질문있습니다.

0

264

1

mustache의 article의 정의가 뭔가요?

0

338

2

17강 Unique index or primary key violation

1

1826

2

8강 에러 질문있습니다.

0

268

1

추상클래스를 사용 할 수있을까요?

0

241

1

22강 과제 질문

0

374

1

22강 질문입니다.

0

368

1

19강 create POST 500 에러

0

454

1

19강 JSON create 메서드 질문이여!!

1

540

1

15강 data.sql코드가 작동하지 않습니다.

1

659

2