Solution | Project Four: Developing A Three-Tier Distributed Web-Based Application Spring 2024

Опубликовано: 19 Июль 2026
на канале: Algopk
255
3

Contact Whatsapp For Code Setup in your Laptop :
Whatsapp : +923054957063
Email : [email protected]

CNT 4714 – Project Four – Spring 2024
Title: “Project Four: Developing A Three-Tier Distributed Web-Based Application”

Objectives: To incorporate many of the techniques you’ve learned this semester into a distributed threetier web-based application which uses servlets and JSP technology running on a Tomcat container/server
to access and maintain a persistent MySQL database using JDBC.
Description: In this assignment you will utilize a suppliers/parts/jobs/shipments database, named
project4 (creation/population script available on Webcourses under Project 4), as the back-end database.
Front-end access to this database by end users will occur through a single page displayed in the client’s web
browser. The schema of the backend database consists of four tables with the following schemas for each
table:
suppliers (snum, sname, status, city) //information about suppliers
parts (pnum, pname, color, weight, city) //information about parts
jobs (jnum, jname, numworkers, city) //information about jobs
shipments (snum, pnum, jnum, quantity) //suppliers ship parts to jobs in specific quantities
The MySQL DBMS will enforce referential integrity via foreign key constraints. The primary key for the
shipments table is a composite key consisting of three foreign keys (the primary keys in the suppliers, parts,
and jobs tables). Referential integrity means that a shipment record cannot exist unless it links back (via
referential integrity) to existing entities on all foreign key values. Thus, a shipment record cannot exist
unless the referenced snum, pnum, and jnum already exist in their respective tables.
The first-tier (user-level front-end) of your web-application will consist of an HTML landing page which
is used to authenticate end users. The authentication of users is handled via a servlet in the webapp that
validates the user entered credentials with those in another database named credentialsDB maintained on
the MySQL DB server. (The credentialsDB is created and populated using the
project4UserCredentialsScript.sql.). This servlet is running as a system-level application
with root user privileges (more later). The credentialsDB contains a single table named usercredentials
of usernames and their associated passwords. Validation consists of matching both the user entered name
and password against the values stored in the usercredentials table. If the user entered credentials do not
match an entry (row) in the usercredentials table, the user will be denied access to the system. If a match
is found, the authenticated the user will be automatically redirected to one of four different JSP pages. One
which handles root-level user clients and one which handles non-root-level clients, that allow the users to
enter arbitrary SQL commands into a window (i.e. a form) and submit them to a server application for
processing. The third JSP page will be consist of dedicated data entry forms for entering new records into
the four tables in the database. This third page will only be used by special data entry users who do not
directly enter SQL commands into the interface, but only enter data into specific tables in the database via
parameterized commands. Finally, a fourth JSP page will be reserved for accountant-level users, who,
similar to data-entry users, do not enter SQL commands directly, but rather execute remote stored
procedures (RPCs) that reside on the database server.

1. Run the project4dbscript.sql script to create the project 4 database
2. Create new dataentryuser using the MySQL Workbench…see project 3 additional document
on creating user accounts in MySQL.
3. Run the project4UserCredentialsScript.sql to set the user credentials for the client,
dataentryuser, and the accountant on the project4 database.
4. Run the permissionsScriptProject4.sql script to set the permissions for the client,
dataentryuser, and accountant-level users.
5. Create properties files for all four end-user types.
6. Create properties file for the system-app level user. This is the internal app used to validate user
credentials, so this properties files contains root-level properties to the credentailsDB