回答編集履歴

1

application.propertiesの記載を追加

2023/08/12 19:46

投稿

growthcoding
growthcoding

スコア2

test CHANGED
@@ -3,6 +3,7 @@
3
3
  以下のソースで動くと思いますので、試してみて下さい。
4
4
 
5
5
  ### BatchConfig.java
6
+ - `src/main/java/com/example/demo/config/BatchConfig.java`
6
7
 
7
8
  ```java
8
9
  package com.example.demo.config;
@@ -41,6 +42,16 @@
41
42
  }
42
43
  ```
43
44
 
45
+ ### application.properties
46
+ - `src/main/resources/application.properties`
47
+
48
+ ```properties
49
+ spring.datasource.url=jdbc:h2:mem:sampledb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
50
+ spring.datasource.username=sa
51
+ spring.datasource.password=
52
+ spring.datasource.driver-class-name=org.h2.Driver
53
+ ```
54
+
44
55
  ## 「Spring Batch 5.0以降に対応した書き方をしているサイト・参考書が知りたい」点について
45
56
 
46
57
  ### 参考書