Petrovich-A / Student

Allows to show on JSP a collection of data from a database using basic JDBC and the PostgreSQL database, which contains two tables: cities and students with a 1:M relationship. The app generates a list of all students and cities. Furthermore, CRUD methods are available for both entities.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Student application

GitHub last commit (branch) GitHub commit activity (branch) GitHub pull requests


πŸ“” Table of Contents

🌟 About the Project

The main task of this project is to display on JSP a group data from database using plain JDBC and the PostgreSQL database. Was created two tables: cities and students with 1:M relationship between two entities respectively. The application allows to generate a list of all students and cities. Moreover, can be displayed a resulting table using SQL queries to database.

The application is able to provide all CRUD methods related to each entity in table. Thus, operations such as adding new cities, new students, deleting students, and deleting cities are available to the user. Some code coverded with unit tests.

The ultimate goal is to develop a fully functioning and reliable web application with the desired capabilities for both the primary task and the secondary task.

πŸ“· Screenshots

Alt text

πŸ‘Ύ Tech Stack

Show
  • Java 1.8.0_282
  • Apache Tomcat 9.0.73
  • Maven 3.8.1
  • PostgreSQL 15.1
  • Project Lombok 1.18.24

🎯 Features

  • CRUD methods for student entity
  • CRUD methods for city entity
  • show resulting 1:M relationship table

πŸƒ Run Locally

Clone the project

  git clone https://github.com/Petrovich-A/Student.git

Go to the project directory and run this script to populate the database tables.

πŸ”‘ Database structure

1:M -> city:students:

city_id SERIAL,
name    text NOT NULL,
PRIMARY KEY (city_id),
UNIQUE (name);
student_id SERIAL,
first_name VARCHAR(40) NOT NULL,
last_name  VARCHAR(40) NOT NULL,
city_id    int         NOT NULL,
PRIMARY KEY (student_id),
FOREIGN KEY (student_id) REFERENCES students (student_id),
FOREIGN KEY (city_id) REFERENCES cities (city_id);

🧭 Have to fix:

  • to add the lombok
  • to add an error page
  • to add checking is entity exists
  • opportunity to delete city which associated with student

🀝 Contact

Petrovich Alexandr - @Petrovich Alexandr - a.piatrovich@gmail.com

πŸ’Ž Acknowledgements

Use this section to mention useful resources and libraries that you have used in your projects.

About

Allows to show on JSP a collection of data from a database using basic JDBC and the PostgreSQL database, which contains two tables: cities and students with a 1:M relationship. The app generates a list of all students and cities. Furthermore, CRUD methods are available for both entities.

License:GNU General Public License v3.0


Languages

Language:Java 95.7%Language:CSS 4.3%