This project implements a basic TCP/IP server in Java that listens for incoming data on a specified port. Upon receiving a message containing a user ID from the client, the server retrieves all vehicles and insurance offers associated with that user from the "users" table in a relational database (PostgreSQL or any other). The server then sends this information back to the client as a response.
- Java Development Kit (JDK) installed
- PostgreSQL installed and running
- Create database using data from postgres.sql file.
- Add db.properties to src/main/resources/ and configure the connection details:
jdbcUrl=jdbc:postgresql://localhost:5432/insurance_db
dbUsername={username}
dbPassword={password}
- Start server application.
- Start client application that connects to the server and sends a message containing a user ID.
- Use console to enter user ID on client side.
- Upon receiving the user ID, the server fetches relevant information from the database and sends it back to the client.
- The client application prints the received information on the console.