A console-based User Authentication & Profile Management System built with Core Java and MySQL via JDBC. This project enables secure user registration, login, profile management, and account deletion β all through an interactive command-line interface.
β User Registration β New users can sign up with name, email, username, and password with data stored directly to MySQL.
β Secure Login β Authenticates user credentials against the database using parameterized queries.
β View Profile β Displays the logged-in userβs complete profile details post-login.
β Update Profile β Allows users to modify their name, email, username, and password.
β Delete Account β Permanently removes user account with a confirmation prompt before deletion.
β User Dashboard β Clean post-login menu to navigate all profile actions seamlessly.
β Logout β Safely exits the current user session back to the home screen.
com.mysql.cj.jdbc.Driver for DB operations.DBconnection.HomePage.java β Entry point; displays main menu (Register / Login / Exit).RegisterUser.java β Handles new user registration and inserts data into the database.LoginPage.java β Authenticates credentials and launches the user dashboard on success.Dashboard.java β Post-login hub for View, Update, Delete, and Logout operations.updateProfile.java β Updates user profile fields in the database by username.DeleteProfile.java β Deletes user account from the database with confirmation.DBconnection.java β Base class providing reusable MySQL connection via JDBC.query.sql β SQL script to create the user_db database and users table.Run the following SQL script in your MySQL client (also available in query.sql):
-- Create Database
CREATE DATABASE user_db;
-- Use Database
USE user_db;
-- Create Users Table
CREATE TABLE users (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(50) NOT NULL,
email VARCHAR(100) UNIQUE NOT NULL,
username VARCHAR(50) UNIQUE NOT NULL,
password VARCHAR(100) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
Open DBconnection.java and set your MySQL credentials:
private String url = "jdbc:mysql://localhost:3306/user_db";
private String username = "your_mysql_username";
private String password = "your_mysql_password";
β οΈ Security Note: Never push real credentials to version control. Use environment variables or a
config.propertiesfile and add it to.gitignore.
HomePage (Main Menu)
β
βββ [1] Register βββββββββββΊ RegisterUser
β βββ Inserts into MySQL β Optional Login redirect
β
βββ [2] Login ββββββββββββββΊ LoginPage
β βββ Authenticates β Dashboard
β βββ [1] View Profile
β βββ [2] Update Profile βββΊ updateProfile
β βββ [3] Delete Account βββΊ DeleteProfile
β βββ [4] Logout
β
βββ [3] Exit
This project demonstrates proficiency in:
Pravin PR
π’ PN Solutions
π Tamil Nadu, India
π‘ This project is built for educational purposes to demonstrate Java-MySQL integration using JDBC. For production use, implement password hashing (BCrypt), input validation, and secure credential management.