A lightweight Java-based management system designed to track and organize lost and found items. This project utilizes JDBC (Java Database Connectivity) to interface with a MySQL backend, providing a structured way to store, retrieve, and manage item records.
- Language: Java (JDK 8+)
- Database: MySQL
- Driver: MySQL Connector/J
- Environment: CLI (Command Line Interface) / IDE (IntelliJ/Eclipse)
| File | Description |
|---|---|
LostFoundDB.sql |
The database script containing table schemas and initial data. |
LostFoundDBApp.java |
The main Java application logic and database connection bridge. |
Follow these steps to set up the project on your local machine.
- Open your MySQL Workbench or Terminal.
- Create a new database:
CREATE DATABASE LostFoundDB;
- In the terminal: mysql -u root -p LostFoundDB < LostFoundDB.sql
- Or simply copy the contents of LostFoundDB.sql and run them in your SQL editor.
- Download the MySQL Connector/J JAR file.
- Open LostFoundDBApp.java and update the connection string with your MySQL credentials:
private static final String URL = "jdbc:mysql://localhost:3306/LostFoundDB"; private static final String USER = "your_username"; private static final String PASS = "your_password";
# Compile
javac -cp ".;mysql-connector-java.jar" LostFoundDBApp.java
# Run
java -cp ".;mysql-connector-java.jar" LostFoundDBApp- (Note: Use : instead of ; in the classpath if you are on macOS or Linux.)
- Add New Records: Log items with descriptions, dates, and locations.
- Database Persistence: Data is stored permanently in a relational database.
- Status Management: Easily differentiate between "Lost" and "Found" statuses.
- Querying: Search for specific items within the database.
Upon running the application, you will be prompted to:
- Report a Lost Item: Input the name and description.
- Report a Found Item: Input the location where it was discovered.
- View All Items: Display a table of all current entries in the system.
This project is for educational purposes and is open-source.