This is a simple console-based chatting application implemented in Java. The program allows users to connect to a server, log in, and engage in real-time chat with other users. The application uses JDBC and MySQL for creating a login database.
- User-friendly console interface.
- Client-server architecture for multi-user communication.
- User authentication using JDBC and MySQL for secure access.
- Real-time messaging between connected clients.
- Graceful handling of client disconnections.
- Dynamic updating of the user list.
- Java Development Kit (JDK)
- MySQL Database
- Basic understanding of Java socket programming, JDBC, and MySQL
- Create a MySQL database named
chatting_application
. - Create a table named
login_info
table with columnsName varchar(50), UserID varchar(50), Password varchar(50)
.
- javac ChatServer.java
- java ChatServer
Add jar file of mysql connector to your project libraries to establish a connection with the database. Download the jar file from offiicial website of MySql or directly during installation.
javac ChatClient.java java ChatClient
Start the server and specify the port. Run multiple instances of the client, providing a username and connecting to the server. Engage in real-time chat with other connected users.
The application handles common errors such as invalid input, connection issues, etc. Provides appropriate messages for errors and guides users to enter valid information.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
The application assumes a local MySQL setup for user authentication. The chat application focuses on simplicity and real-time messaging without advanced features such as file sharing or multimedia. Feel free to contribute and enhance the functionality of the chatting application!
Rafan R. Nadiadwala: https://www.linkedin.com/in/rafan-nadiadwala-062b70262