This projects aims to realize a flight booking application. It enables us to create user account, search and book desired flights, as well as check reservation information. As always, you have the right to cancel booked flights. This application is achieved by Java and SQL languages.
This method enables us to create a user account, including username, password and balance.
Using login command to sign in our account.
- Search method can display the full flights information once we executed it, such as flight number, departing time, price and etc.
- when the value of
<direct>
variable is 1, it means the searching flights are direct. On the contrary, the result will be indirect flights if we input 0 for that item; - The range for
<day>
variable is from 1 to 31. It represents the day of month; <num itineraries>
means the number of flights you are going to search.
Once you confirmed a flight, you could utilize the book
function to reserve the airline.
After reservation, all you need is to pay
it.
If you need to check your reservations, just type the command reservations
. It will display all your reserved flights.
If you changed you idea about one itinerary, just cancel
it!
quit
helps us to exit the application.
*** Please enter one of the following commands ***
> create <username> <password> <initial amount>
> login <username> <password>
> search <origin city> <destination city> <direct> <day> <num itineraries>
> book <itinerary id>
> pay <reservation id>
> reservations
> cancel <reservation id>
> quit
- Use
git clone
to download the whole files:
git clone https://github.com/xuliang2019/Flights.git
- Create the three needed tables using
createTables.sql
according to the instruction mentioned in thedocuments/table explanation
; - Import flights data into cloud database;
- Set the
dbconn.properties
parameters.Open it and you will see detail instructions. In my work, I created a database onAzure
; - Finally, open a
CMD
and navigate to the cloned folder. Under the directory ofcode
, run the command:
java -jar flights/flightapp-1.0-jar-with-dependencies.jar
And you will see above interface. Congratulations!
You can download the instruction video here