Railway reservation system which handles concurrent requests for booking tickets in postgress. It uses explicit locking to handle parallel requests.
- Make a
config.properties
file in theJava/
directory and store the name of thedatabase
,user
and itspassword
as followingdatabase=XXXXXX user=XXXXXX password=XXXXXX
- Make a database in postgresql then run
setup.sql
(change the paths before running)\i setup.sql
- Download JDBC driver and keep it in
Java/
directory - Make two directories
Input/
andOutput/
and keep ininput files
inInput/
folder - Make a
Trainschedule.txt
file inJava/
folder
-
First we need to add all the train by running ReleaseTrain and Train schedule resides in Trainschedule
or
specify the path of the filejavac ReleaseTrain.java && java ReleaseTrain
-
Then, run Service Module which will keep listening for connections from the client and book tickets using multithreading.
javac ServiceModule.java && java ServiceModule
-
Now, open a new terminal and run the Client which will send parallel requests to Service Module. This will read the input files present in
Input/
directory and give the output inOutput/
directoryjavac *.java && java client
&
is added so that the Service module runs in background (no need to open a new terminal ✌️)javac ReleaseTrain.java && java ReleaseTrain javac ServiceModule.java && java ServiceModule & javac *.java && java client
Under the guidance of Dr. Vishwanath Gunturi :
Name | Entry Number |
---|---|
Sukhmeet Singh | 2020CSB1129 |
Vishnusai Janjanam | 2020CSB1142 |