📚 Library Management System (Java + MySQL)
A desktop-based Library Management System built using Java Swing, JDBC, and MySQL. It supports user authentication, book management, issuing/returning books, and simple library operations with a clean GUI.
🚀 Features
✅ User Authentication
● Admin login
● Secure credential validation via MySQL
✅ Book Management
● Add new books
● View all books
● Update book availability
● Delete books
✅ Book Issue & Return
I● ssue books to users
● Track due dates
● Return books
● Maintain issue log history
✅ User Management
● Register new users
● View all registered users
✅ Deployment
● Packaged as a runnable JAR
● Uses MySQL Connector/J for DB connectivity
🛠️ Tech Stack
| Component | Technology |
|---|---|
| Frontend | Java Swing |
| Backend | Java (JDK 8+), JDBC |
| Database | MySQL |
| Build | Runnable JAR |
| IDE | NetBeans / VS Code / IntelliJ |
🗄️ Database Setup
Run the following SQL commands in MySQL:
CREATE DATABASE librarydb; USE librarydb;
CREATE TABLE users ( id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(200), username VARCHAR(100) UNIQUE, password VARCHAR(100), role VARCHAR(50) DEFAULT 'ADMIN' );
INSERT INTO users (name, username, password, role) VALUES ('Admin User', 'admin', 'admin', 'ADMIN');
CREATE TABLE books ( id INT AUTO_INCREMENT PRIMARY KEY, title VARCHAR(255), author VARCHAR(255), category VARCHAR(100), is_issued BOOLEAN DEFAULT FALSE );
CREATE TABLE issue_log ( id INT AUTO_INCREMENT PRIMARY KEY, user_id INT, book_id INT, issue_date DATE, due_date DATE, return_date DATE, FOREIGN KEY (user_id) REFERENCES users(id), FOREIGN KEY (book_id) REFERENCES books(id) );
⚙️ How to Run
1️⃣ Install Dependencies
● JDK 8 or above
● MySQL
● MySQL Connector/J
2️⃣ Place MySQL Connector
● Add the MySQL connector JAR inside the lib/ folder.
Example:
lib/mysql-connector-j-8.3.0.jar
3️⃣ Run the App
● If using the JAR:
java -jar LibrarySystem.jar
📁 Project Structure
src/ ├── Login.java ├── Register.java ├── Dashboard.java ├── AddBook.java ├── ViewBooks.java ├── DeleteBook.java ├── IssueBook.java ├── ReturnBook.java ├── ViewUsers.java └── Database.java lib/ manifest.txt LibrarySystem.jar README.md
✨ Screenshots
🤝 Contributing
Pull requests are welcome! Feel free to open issues for suggestions or bugs.
📜 License
This project is open-source and free to use.