Skip to content

Do-nny/COS221-PA4

Repository files navigation

COS221 Practical Assignment 4

Students: u24841430 and u24702341

REQUIREMENTS

  • Java JDK 11 or higher
  • Maven 3.6 or higher
  • MySQL or MariaDB server running

SETUP

  1. Clone the repository
git clone git@github.com:Do-nny/COS221-PA4.git
  1. Copy the .env template and fill in your credentials

    cp .env.example .env
    
  2. 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
    
  3. Make sure your Chinook database is running and imported

    • Open MySQL Workbench
    • Run the Chinook_MySql.sql script if not already done

BUILD

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.

RUN

mvn exec:java -Dexec.mainClass="com.mycompany.cos221pa4.MainWindow"

Or alternatively run the JAR directly:

java -jar target/COS221PA4-1.0-SNAPSHOT.jar

RUNNING IN NETBEANS

  1. Open NetBeans
  2. File -> Open Project -> select this folder
  3. Copy .env.example to .env and fill in credentials
  4. Press F6 to run

NOTES

  • 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/

FILE STRUCTURE

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

About

A github repo for the COS221 practical assignment 4 , 2026

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages