UsersCRUD is a lightweight CRUD (Create, Read, Update, Delete) web application built with a focus on core Java backend fundamentals. It demonstrates the implementation of the MVC architecture without the overhead of heavy frameworks like Spring.
- Full Lifecycle Management: Seamlessly Create, Read, Update, and Delete user records.
- Security First: Robust password hashing using the BCrypt algorithm.
- Data Integrity: Complete protection against SQL Injection through the use of
PreparedStatement. - Responsive UI: Clean and functional views built with JSP and JSTL.
The project strictly follows the Model-View-Controller (MVC) design pattern to ensure high maintainability and clear separation of concerns:
| Package | Responsibility |
|---|---|
entity |
Data models and POJOs (e.g., User class). |
dao |
Data Access Object layer; handles all direct JDBC interactions. |
servlets |
Controllers managing HTTP requests and routing logic. |
utils |
Utility classes for database connectivity and security helpers. |
- Language: Java 17 (Compatible with Java 8+)
- Server: Jakarta Servlets (deployed on Apache Tomcat)
- Database: MySQL 8.0
- Persistence: JDBC (Java Database Connectivity)
- Security: BCrypt Hashing
- Frontend: JSP, JSTL, HTML/CSS
- Build Tool: Maven
To ensure production-grade security standards in a learning project:
- Password Protection: We never store plain-text passwords. Every password is salted and hashed using BCrypt.
- Query Safety: All database communication is parameterized to eliminate the risk of SQL injection attacks.
- Encapsulation: Sensitive data is excluded from
toString()methods to prevent accidental exposure in application logs.
Run the following script in your MySQL terminal to prepare the environment:
CREATE DATABASE users_db;
USE users_db;
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(50) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
email VARCHAR(100) NOT NULL
);