VisitorLog is a Java-based console application that helps track and manage visitor entries using a MySQL database. Designed for use in offices, institutions, or any space with regular foot traffic, VisitTrack provides a simple way to record guest details, update visitor info, and mark exit times โ all from a terminal interface. It ensures visitor data is organized, timestamped, and accessible for future reference.
- View all current and past visitors
- Add new visitor details
- Update existing visitor information
- Mark visitor exit time
- Exit the system safely
- Java JDK 8 or higher
- MySQL Server
- MySQL JDBC Driver (
mysql-connector-java) - An IDE or terminal to compile and run Java programs
- Create a database:
CREATE DATABASE students;- Use the database:
USE students;- Create the visitors table:
CREATE TABLE visitors (
Sno INT AUTO_INCREMENT PRIMARY KEY,
Name VARCHAR(100) NOT NULL,
visited_from VARCHAR(100),
Gender VARCHAR(10),
Date_of_visit DATE,
Time_of_visit TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
Time_of_Exit TIMESTAMP NULL
);Update the following database credentials in your Java code
String url = "jdbc:mysql://localhost:3306/students";
String username = "root";
String password = "your_mysql_password_here";- Compile the Java Program:
javac visitors_db.java- Run the Program:
java visitors_db- Follw the on-screen menu to perform actions:
1. Display Visitors
2. Add New Visitor
3. Update Visitor Details
4. Mark Exit Time
5. Exit




