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.
- Gradle 9.2+ (via wrapper)
- JDK 21
- Postgresql (to run psql)
- Spring Boot (installed with Gradle)
- Thymeleaf (integrated with Springboot)
- JDBC API
Install PostgreSQL and psql
Ensure server is running
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;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 pluginOpen multiple terminals, preferrably one with the database and another for running Main.java.