{"id":22158141,"url":"https://github.com/nickklos10/three-tier-distributed-web-application","last_synced_at":"2026-04-11T21:44:09.684Z","repository":{"id":264553596,"uuid":"892748495","full_name":"nickklos10/Three-Tier-Distributed-Web-Application","owner":"nickklos10","description":"A servlet/JSP-based multi-tiered enterprise application using a Tomcat container that allows clients, accountants and root-level users to execute SQL queries.","archived":false,"fork":false,"pushed_at":"2024-11-26T15:10:25.000Z","size":70,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T14:48:46.890Z","etag":null,"topics":["ajax","apache-tomcat","html-css-javascript","java","java-ee","jdbc","jsp-servlet","mysql"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nickklos10.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-22T17:46:07.000Z","updated_at":"2024-11-26T15:10:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"1a8b6b78-fc05-4164-834a-5c304246b446","html_url":"https://github.com/nickklos10/Three-Tier-Distributed-Web-Application","commit_stats":null,"previous_names":["nickklos10/three-tier-distributed-web-application"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nickklos10/Three-Tier-Distributed-Web-Application","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickklos10%2FThree-Tier-Distributed-Web-Application","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickklos10%2FThree-Tier-Distributed-Web-Application/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickklos10%2FThree-Tier-Distributed-Web-Application/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickklos10%2FThree-Tier-Distributed-Web-Application/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nickklos10","download_url":"https://codeload.github.com/nickklos10/Three-Tier-Distributed-Web-Application/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickklos10%2FThree-Tier-Distributed-Web-Application/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264506245,"owners_count":23619003,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ajax","apache-tomcat","html-css-javascript","java","java-ee","jdbc","jsp-servlet","mysql"],"created_at":"2024-12-02T03:19:07.611Z","updated_at":"2026-04-11T21:44:04.632Z","avatar_url":"https://github.com/nickklos10.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Three tier distributed Web App for an Enterprise system\n\nA servlet/JSP-based multi-tiered enterprise application using a Tomcat container that allows clients, accountants and root-level users to execute SQL queries and updates with specific business logic implementation.\n\n## Table of Contents\n- [Introduction](#introduction)\n- [Technologies Used](#technologies-used)\n- [Features](#features)\n- [Prerequisites](#prerequisites)\n- [Installation](#installation)\n- [Database Setup](#database-setup)\n- [Configuration](#configuration)\n- [Running the Application](#running-the-application)\n- [Usage](#usage)\n- [Business Logic Implementation](#business-logic-implementation)\n\n## Introduction\nThis project is a multi-tiered enterprise system that demonstrates the use of servlets and JSPs in a Tomcat container. It provides a web interface for clients, accountants and root-level users to execute SQL commands on a database. The application includes server-side business logic that automatically updates supplier statuses based on certain conditions.\n\n## Technologies Used\n- Java EE Servlets\n- JavaServer Pages (JSP)\n- Apache Tomcat\n- JDBC (Java Database Connectivity)\n- MySQL Database\n- HTML, CSS, JavaScript\n- AJAX (Fetch API)\n- Bootstrap (optional for styling)\n\n## Features\n- **Authentication System**: Users can log in as either client-level or root-level users\n- **SQL Command Execution**: Users can execute SQL queries and updates through a web interface\n- **Dynamic Result Display**: Query results are displayed dynamically on the same page without reloading\n- **Server-Side Business Logic**: Automatically increments the status of suppliers based on shipment quantities\n- **Error Handling**: Displays user-friendly error messages for invalid SQL commands or server errors\n- **Security**: Session validation to prevent unauthorized access\n\n## Prerequisites\n- Java Development Kit (JDK) 8 or higher\n- Apache Tomcat 9 or higher\n- MySQL Database Server\n- Maven (for building the project, if applicable)\n- An IDE like Eclipse or IntelliJ IDEA (optional but recommended)\n\n## Installation\n\n### Clone the Repository\n```bash\ngit clone https://github.com/nickklos10/Three-Tier-Distributed-Web-Application.git\n```\n\n### Import the Project into Your IDE\nOpen your IDE and import the project as a Maven project (if using Maven).\n\n### Build the Project\nIf using Maven:\n```bash\nmvn clean install\n```\nAlternatively, build the project using your IDE's build tools.\n\n## Database Setup\n\n1. Create the Project 4 Database and populate it:\n    - Log in to your MySQL server and run the contents of file project4DBscript.sql \n\n2. Create the Credentials DB and populate it:\n    - Run the contents of file credentialsDBscript.sql \n\n3. Create the users and give permissions:\n    - Run the contents of file ClientCreattionPermissionsScript.sql\n\n## Configuration\n\n### Database Configuration Files\nCopy the client-level.properties, root-level.properties and accountant-level.properties files to the WEB-INF/lib directory.\n\nUpdate the database connection details (URL, username, password) in both properties files.\n\n#### client-level.properties\n```properties\njdbc.driver=com.mysql.cj.jdbc.Driver\njdbc.url=jdbc:mysql://localhost:3306/project4\njdbc.username=client\njdbc.password=client\n```\n\n#### root-level.properties\n```properties\njdbc.driver=com.mysql.cj.jdbc.Driver\njdbc.url=jdbc:mysql://localhost:3306/project4\njdbc.username=root\njdbc.password=root_password\n```\n#### accountant-level.properties\n```properties\njdbc.driver=com.mysql.cj.jdbc.Driver\njdbc.url=jdbc:mysql://localhost:3306/project4\njdbc.username=theaccountant\njdbc.password=theaccountant\n```\n\n### Tomcat Configuration\n- Deploy the compiled .war file to your Tomcat server's webapps directory\n- Alternatively, configure your IDE to deploy the application to Tomcat directly\n\n## Running the Application\n\n### Start the Tomcat Server\nEnsure that your Tomcat server is running.\n\n### Access the Application\nOpen a web browser and navigate to:\n```\nhttp://localhost:8080/Three-Tier-Distributed-Web-Application\n```\n\n## Usage\n\n### Client-Level User\n\n#### Login\nNavigate to the login page and enter the client-level credentials:\n```\nUsername: client\nPassword: client\n```\n\n#### Features\n- Can execute SELECT statements\n- Limited to client-level database permissions\n\n### Root-Level User\n\n#### Login\nNavigate to the login page and enter the root-level credentials:\n```\nUsername: root\nPassword: root_password\n```\n\n#### Features\n- Can execute all SQL statements, including INSERT, UPDATE, DELETE\n- Has root-level database permissions\n- Triggers server-side business logic for certain operations\n\n### Accountant-Level User\n\n#### Login\nNavigate to the login page and enter the accountant-level credentials:\n```\nUsername: theaccountant\nPassword: theaccountant\n```\n\n#### Features\n- Can only execute a pre-selected amount of SQL statements.\n\n\n## Business Logic Implementation\n\nThe application implements server-side business logic for the root-level user:\n\n**Condition**: Any INSERT or UPDATE on the shipments table where the quantity is greater than or equal to 100.\n\n**Action**: Increments the status of suppliers directly affected by the operation by 5.\n\nExample:\n- Inserting a shipment (S5, P6, J4, 400) increases the status of supplier S5 by 5\n- Updating shipments with quantity \u003e= 100 affects only the suppliers involved in those shipments\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickklos10%2Fthree-tier-distributed-web-application","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnickklos10%2Fthree-tier-distributed-web-application","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickklos10%2Fthree-tier-distributed-web-application/lists"}