Students: u24841430 and u24702341
- Java JDK 11 or higher
- Maven 3.6 or higher
- MySQL or MariaDB server running
- Clone the repository
git clone git@github.com:Do-nny/COS221-PA4.git
-
Copy the .env template and fill in your credentials
cp .env.example .env -
Open .env and fill in your details
CHINOOK_DB_PROTO=jdbc:mysql CHINOOK_DB_HOST=localhost CHINOOK_DB_PORT=3306 CHINOOK_DB_NAME=uXXXXXXXX_chinook CHINOOK_DB_USERNAME=your_username CHINOOK_DB_PASSWORD=your_password -
Make sure your Chinook database is running and imported
- Open MySQL Workbench
- Run the Chinook_MySql.sql script if not already done
Navigate to the project root folder (where pom.xml is) and run:
mvn clean package
This will produce a JAR file in the target/ folder.
mvn exec:java -Dexec.mainClass="com.mycompany.cos221pa4.MainWindow"
Or alternatively run the JAR directly:
java -jar target/COS221PA4-1.0-SNAPSHOT.jar
- Open NetBeans
- File -> Open Project -> select this folder
- Copy .env.example to .env and fill in credentials
- Press F6 to run
- The .env file is gitignored and will not be in the repository
- Use .env.example as a template for your own .env file
- All SQL queries are located in src/main/resources/sql/
COS221PA4/
│
├── .env ← Your local database credentials (gitignored)
├── .env.example ← Credentials template (copy this to .env)
├── .gitignore
├── pom.xml ← Maven build config and dependencies
├── README.md
│
└── src/main/
├── java/com/mycompany/cos221pa4/
│ ├── MainWindow.java ← Main application window and tab container
│ ├── DBConnection.java ← Database connection handler
│ ├── DBQueries.java ← All SQL query methods
│ ├── SQLLoader.java ← Loads .sql files from resources
│ ├── EmployeesPanel.java ← Employees tab (listing + filter)
│ ├── TracksPanel.java ← Tracks tab (listing + add track)
│ ├── AddTrackDialog.java ← Popup dialog for adding a new track
│ ├── ReportsPanel.java ← Reports tab (genre revenue report)
│ ├── NotificationsPanel.java ← Notifications tab (customer CRUD + inactive)
│ └── RecommendationsPanel.java ← Customer insights and recommendations tab
│
└── resources/sql/
├── getEmployees.sql
├── filterEmployees.sql
├── getTracks.sql
├── addTrack.sql
├── getAlbums.sql
├── getGenres.sql
├── getMediaTypes.sql
├── genreRevenueReport.sql
├── getCustomers.sql
├── createCustomer.sql
├── updateCustomer.sql
├── deleteCustomer.sql
├── deleteCustomerInvoices.sql
├── deleteCustomerInvoiceLines.sql
└── getInactiveCustomers.sql