You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Exporting data from a database to a CSV file (DB to CSV).
6
6
2. Importing data from a CSV file into a database (CSV to DB).
7
7
8
-
## 🐳 Docker Setup
9
-
If Docker is not available, download it from the [official Docker website](https://www.docker.com/get-started). Follow the installation instructions for your operating system.
10
-
11
-
## How to Run
12
-
Steps:
13
-
1. Build and run the MySQL container:
8
+
## 🐳 Database Setup
14
9
```bash
15
-
docker compose down && docker compose build && docker compose up -d
16
-
```
10
+
# Start MySQL container
11
+
docker compose up -d
17
12
18
-
2. Connect to the MySQL container and verify the setup:
19
-
```bash
13
+
# Verify database setup
20
14
docker exec -it mysql-container mysql -u sampleuser -psamplepassword sampledb
21
15
22
-
mysql> show databases;
23
-
24
-
mysql> show tables;
25
-
26
-
mysql> SELECT * FROM member;
27
-
28
16
mysql> SELECT * FROM member WHERE delete_flag = 0 AND type IN (1, 2, 3) ORDER BY type ASC;
29
-
30
-
mysql>exit;
31
-
```
32
-
## 💻 Step-by-Step Guide:
33
-
1. Generate the JAR file
34
-
Execute the default task to generate the Spring Boot JAR file:
35
-
```bash
36
-
cd dbAndCsvBatch
37
-
../gradlew
38
17
```
39
-
40
-
2. Verify Generated Files
41
-
Confirm that the entity classes and JAR file were successfully created:
The SkeletonBatch module is a streamlined template designed to help you create custom batch jobs effortlessly with Spring Batch. Simply add your business logic, and you’ll have a fully operational Spring Boot 3 batch application in no time.
4
+
The SkeletonBatch module is a streamlined template designed to help you create custom batch jobs effortlessly with Spring Batch. Simply add your business logic, and you'll have a fully operational Spring Boot 3 batch application in no time.
6
5
7
6
---
8
7
9
-
## 🔧 How to Run
8
+
## 🔧 How to Run
10
9
11
-
### Step-by-step Instructions
10
+
### 1️⃣ Using Gradle (Recommended)
12
11
```bash
13
-
# Navigate to the skeletonBatch directory
14
-
cd skeletonBatch
12
+
# Build and Run from project root
13
+
./gradlew :skeletonBatch:bootRun
14
+
```
15
15
16
-
# Execute the default task to generate the JAR file
17
-
../gradlew
16
+
### 2️⃣ Using JAR File
17
+
Useful for running with cron jobs or job schedulers. Generate and execute the JAR file as follows:
18
18
19
-
# Confirm that the Spring Boot JAR file has been generated
20
-
ls -ls build/libs/skeletonBatch-*.jar
19
+
### Generate JAR
20
+
```bash
21
+
# Generate executable JAR
22
+
cd skeletonBatch
23
+
../gradlew
21
24
22
-
#Run the skeleton batch application
23
-
java -jar build/libs/skeletonBatch-*.jar
25
+
#Check generated JAR
26
+
ls -l build/libs/
24
27
```
28
+
### Execute JAR
29
+
```bash
30
+
# Basic execution (requires JDK 21)
31
+
java -jar build/libs/batch-skeleton-*.jar
25
32
26
-
## ✨ Highlights
27
-
- Simple Setup: Pre-configured tasks for quick builds.
28
-
- Fast Execution: Minimal effort to start your batch job.
29
-
- Customizable: Extend the template with your business logic.
0 commit comments