BA
Bahaaio/TaskTracker
A simple Java CLI app for tracking tasks using JDBC and H2.
Task Tracker CLI
A command-line task management application built to practice core Java database technologies.
๐ก Learning Goals
This project focuses on mastering fundamental Java database concepts:
- โ JDBC and SQL with Java
- โ Connection pooling with HikariCP
- โ In-memory and file-based databases using H2
- โ Clean project structure (DAO pattern, Mapper classes)
- โ Unit testing with JUnit 5
- โ CLI development with PicoCLI
The goal is to build solid foundations in Java database access (JDBC) before transitioning to frameworks like JPA or
Spring Boot.
๐ Tech Stack
- Java 21 - Programming language
- H2 Database - Embedded SQL database
- HikariCP - High-performance connection pooling
- PicoCLI - Command-line interface framework
- JUnit 5 - Testing framework
- Gradle - Build automation (Kotlin DSL)
๐ Building and Running
Prerequisites
- Java 21 or higher
- No additional setup required (Gradle wrapper included)
Build the Application
./gradlew buildSetup (Recommended)
# Make the script executable
chmod +x task-cli
# Enable tab completion for commands (optional)
source task-cli_completion๐ก Tip: Press TAB after a partial command to view available options with tab completion enabled.
Usage Examples
General Commands
# Show help
./task-cli --help
# Show version
./task-cli --versionโน๏ธ Tip: You can use
--helpwith any subcommand (e.g.,./task-cli add --help) to see detailed options.
Adding a new task
./task-cli add "Learn JDBC" -d "Practice database operations"Updating and deleting tasks
# Update task title
./task-cli update 1 -t "Master JDBC fundamentals"
# Update task description
./task-cli update 1 -d "Complete all JDBC exercises"
# Update both title and description
./task-cli update 1 -t "New Title" -d "New Description"
# Delete a task
./task-cli delete 1Marking a task's status
# Mark task as done
./task-cli mark done 1
# Mark task as todo (reopen)
./task-cli mark todo 1Listing Tasks
# List all tasks
./task-cli list
# List only completed tasks
./task-cli list done
# List only pending tasks
./task-cli list todoAlternative: Run with Gradle
If you prefer not to use the script:
./gradlew run --args="add 'Task title'"