Skip to content

ehhdyyy/UniversityDatabase

Repository files navigation

University Database

Java + JDBC demo with PostgreSQL database

This is a University Database Management System designed for university administrators to register students into the database. This system supports courses, course sections, student indexing, student enrollments, and student grade records for courses.

Tech Stack

  • Gradle 9.2+ (via wrapper)
  • JDK 21
  • Postgresql (to run psql)
  • Spring Boot (installed with Gradle)
  • Thymeleaf (integrated with Springboot)
  • JDBC API

Important Notes

1. PostgreSQL

Install PostgreSQL and psql
Ensure server is running

2. Create the Database (one time)

Connect as a superuser (usually postgres) and create DB + app user:

psql -U postgres
--- inside psql
CREATE DATABASE universitydb;

--- Matches jdbc username and password set in 'applications.properties'
CREATE USER admin WITH PASSWORD 'password';
GRANT ALL PRIVILEGES ON DATABASE universitydb TO admin;

---connects to 'universitydb'
\c universitydb 

--allows jdbc schema public privileges 
GRANT ALL PRIVILEGES ON SCHEMA public TO admin;
ALTER SCHEMA public OWNER TO admin;

3. Build & Run (Gradle Wrapper)

Always run from backend/ (where build.gradle lives)

# shows Gradle + JVM versions
./gradlew -v            # macOS/Linux
.\gradlew.bat -v        # Windows

# compile & run 
./gradlew run | bootRun            # macOS/Linux
.\gradlew.bat run | bootRun        # Windows

# 
'gradlew bootrun' is a specialized Gradle task provided by Spring Boot Gradle plugin

4. Testing Code

Open multiple terminals, preferrably one with the database and another for running Main.java.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors