Desktop Library Management app with Admin and Student roles.
- Java 17+
- Maven 3.8+
- XAMPP MySQL (running on localhost)
- Start MySQL from XAMPP Control Panel
- Create database and tables:
- Option A: Using phpMyAdmin → import
schema.sql - Option B: Command line:
mysql -u root -p < schema.sql
- Option A: Using phpMyAdmin → import
- Optional: Insert your student registration numbers into
studentstable.
Edit lms/db/Database.java and set username/password. They are intentionally empty with a comment showing where to change:
private static final String DB_USERNAME = ""; // <-- enter your MySQL username (e.g., "root")
private static final String DB_PASSWORD = ""; // <-- enter your MySQL password (often empty on XAMPP)Default URL uses database library_db:
jdbc:mysql://localhost:3306/library_db?useSSL=false&serverTimezone=UTC
mvn -q -DskipTests exec:javaOr from IDE, run lms.Main.
- Username:
admin - Password:
admin123
You can change these in lms/ui/AdminLoginFrame.java.
- Student:
- Login with Registration Number
- View available books and counts
- Borrow selected book (decrements count)
- Return previously borrowed book (increments count)
- Logout
- Admin:
- View active borrowed books with student Reg. No
- Add Book (name + count)
- For XAMPP, MySQL default user is often
rootwith an empty password. UpdateDatabase.javaaccordingly. - If you change the DB name/port, update
DB_URLinDatabase.java.