☕ A small Java practice project with exercises from beginner to advanced level.
This project includes simple console programs, file handling examples, a binary tree exercise, a chat app, and a library system connected to MySQL.
- Level 1 (Basic): ✅ 2/2 Tasks Completed (Factorial, Guessing Game) [5, 6]
- Level 2 (Intermediate): ✅ 2/2 Tasks Completed (Employee System, File Processor) [7, 8]
- Level 3 (Advanced): ✅ 3/2 Tasks Completed (Binary Tree, Library System, Chat Service) [9, 10]
A small program that calculates the factorial of a non-negative number.
Run it:
javac -d bin level_1_Basic\FactorialTask.java
java -cp bin level_1_Basic.FactorialTaskExample:
Enter a positive number: 5
The factorial of 5 is: 120A simple number guessing game with limited attempts.
Run it:
javac -d bin level_1_Basic\GuessingGame.java
java -cp bin level_1_Basic.GuessingGameA small employee manager that stores records in memory and lets you add, view, update, and delete them.
Run it:
javac -d bin levl_2_Intermediate\EmployeeSystem.java
java -cp bin EmployeeSystemA program that reads a text file, counts lines and words, and writes the result to an output file.
Run it:
javac -d bin levl_2_Intermediate\FileProcessor.java
java -cp bin FileProcessorA basic binary search tree example with insert, search, and traversal operations.
Run it:
javac -d bin level_3_Advanced\BinaryTree.java
java -cp bin BinaryTreeA small console app that connects to MySQL and lets you add books and view them.
Run it:
javac -cp ".\level_3_Advanced\lib\mysql-connector-j-9.6.0.jar" -d ".\bin" ".\level_3_Advanced\LibrarySystem.java"
java -cp ".\bin;.\level_3_Advanced\lib\mysql-connector-j-9.6.0.jar" level_3_Advanced.LibrarySystemA basic chat app with a server and a client using sockets.
Run the server:
javac -d bin level_3_Advanced\ChatServer.java
java -cp bin level_3_Advanced.ChatServerRun the client:
javac -d bin level_3_Advanced\ChatClient.java
java -cp bin level_3_Advanced.ChatClientThe library app connects to a MySQL database called codveda. Start the database first and create the table used by the app.
Start the database with Docker:
docker compose -f infractrusture/docker-compose.yml up -dOpen the MySQL shell:
docker exec -it mysql_codveda mysql -u root -prootCreate the database and table:
CREATE DATABASE IF NOT EXISTS codveda;
USE codveda;
CREATE TABLE IF NOT EXISTS books (
id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(100) NOT NULL,
author VARCHAR(100) NOT NULL
);The Java program expects these connection values:
- host:
localhost - port:
3306 - database:
codveda - user:
root - password:
root
Optional sample data:
INSERT INTO books (title, author) VALUES ('Clean Code', 'Robert C. Martin');
INSERT INTO books (title, author) VALUES ('Effective Java', 'Joshua Bloch');If you get a connection error, check that Docker is running, the container is active, and the books table exists.
Java, MySQL, and Docker.
This project was built by Alejandro Fuentes for the Codeva Java Development internship.
This project is part of my journey with @Codveda.
#CodvedaJourney #CodvedaExperience #FutureWithCodveda #CodvedaAchievements #CodvedaProjects