In-House Training Project On
Reservation System Using JAVA Submitted to AMITY SCHOOL OF ENGINEERING AND TECHNOLOGY
GUIDED BY: Ms. Smriti Sehgal
SUBMITTED BY: Dishank Saxena A2305212312 5CSE-6 (X)
1
CANDIDATE’S DECLARATION
I DishankSaxena student of B.Tech (CSE) hereby declare that the project titled “RESERVATION SYSTEM USING JAVA” a JAVA Application which is submitted by me to The Department of CSE , Amity School of Engineering and Technology , Amity University Uttar Pradesh , Noida, in partial fulfillment of requirement of award of the degree of Bachelor of Technology in CSE, has not been previously formed the basis for the award of any degree, diploma or other similar title or recognition.
DISHANK SAXENA (A2305212312) CSE, ASET NOIDA
2
ACKNOWLEDGEMENT
I feel very greatfull to thank all the people who have helped me and supported me in completing my In-House Project. My deepest thanks to my faculty, Ms. Smriti Sehgal, the mentor of the project, for guiding and correcting me with attention and care. I greatly appreciate the efforts she took to go through my data and make necessary corrections as and when needed. I also express my thanks to Dr. Abhay Bansal, The Head Of Department (HOD), and Mr. Praveen Kumar, The Program leader (PL), for extending their support. Words are inadequate in offering my thanks to the various helpful people of Amity University for their encouragement and cooperation in carrying out the project work. I would also thank my Institution and my faculty members without whom this project would have been a distant reality. Finally, yet importantly, I would like to express my heartfelt thanks to my beloved parents for their blessings, my friends/classmates for their help and wishes for the successful completion of this project.
Dishank Saxena A2305212312 CSE, ASET NOIDA
3
CERTIFICATE
This is to certify that Mr.Dishank Saxena, student of B. Tech. in CSE has carried out the work presented in the project of the Practical Training-I entitled “Reservation System Using JAVA” as a part of Second year program of Bachelor of Technology in CSE from Amity School of Engineering and Technology, Amity University, Noida, Uttar Pradesh under my supervision.
Ms. Smrit Sehgal ASET Noida, U.P.
4
Table Of Contents
CONTENTS CANDIDATE’S DECLARATION………………………………………II ACKNOWLEDGEMENT………………………………………………..III CERTIFICATE……………………………………………………….......IV ABSTRACT…………………………………………………………….....VI 1. INTRODUCTION 1.1 INTRODUCTION……………………………………………..7-8 1.2 FUNCTIONING & TECHNOLOGY………………………...7-9 1.3 HISTORY OF BROWSERS…………………………………..9-11 2. MATERIALS AND METHODS 2.1 REQUIREMENT ANALYSIS……………………………….12 2.2 MICROSFT VISUAL STUDIOS…………………………...13-15 2.3 C# LANGUAGE………………………………………………16-17 2.4 XAML LANGUAGE…………………………………………18 3. RESULTS AND DISCUSSION 3.1 ACTIVITY DIAGRAM………………………………………19 3.2 OUTPUTS & SCREENSHOTS…………………………….20-23 4. CONCLUSION……………………………………………………..24 5. FUTURE SCOPE…………………………………………………..24 6. REFERENCES……………………………………………………..26
5
ABSTRACT
The purpose of this project is enhance and make the reservation system more advanced for the users. This project helps in removing all the unsatisfied features and helps in making them more efficient and advanced. The project also highlights the various softwares and tools used for the reservation system.
The JAVA application has a very simple and user friendly GUI making user experience easier, and runs on a executable .JAR file.
Since The reservation system is handled by a website i.e www.irctc.co.in it is a very heavy website. And when multiple users are logged in then the server is unable to take the load , due to which the users cannot access different pages and are unable to reserver their tickets on time. It has some missing features which are added in my JAVA application.
Though IRCTC has evolved with newer versions in the past but still it is not able to give proper facility of reservation for users. My JAVA application contains no lag when multiple users are logged in and it also contains newly added features that includes saving the journey to “Favourites” for future access , saving the payment card for “Quick Payment” in future transactions.
6
INTRODUCTION
Java is a computer programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere" (WORA), meaning that code that runs on one platform does not need to be recompiled to run on another. A JAVA application has been made with the help of the tool Netbeans 7.4. Java applications are typically compiled to byte code that can run on any Java virtual machine (JVM). The JAVA based applications are basically designed on a platform called Netbeans. This tool is provides Very advanced interface for the programmer to create code and GUI for the software. The basic preview of the code is also available for users’s convenience. JAVA Application development is very useful for making various kinds of Applications . Netbeans has all the basic and the advanced tool for creating a JAVA based application. It has an auto guide option which automatically guides u about how to remove the errors appearing in the code. And also helps in debugging those errors. JAVA applications helps in interacting with the user and making the work easier and convenient. JAVA also provides connection to DATABASE and syncing the software with the SQL database for storing and retrieving records of different users. Connection to database greatly helps in creating and full fledged and efficient Java Application. 7
About JAVA
Java is a set of several computer software products and specifications from Oracle Corporation that provides a system for developing application software and deploying it in a cross-platform computing environment. Java is used in a wide variety of computing platforms from embedded devices and mobile phones on the low end, to enterprise servers and supercomputers on the high end. While less common, Java applets are sometimes used to provide improved and secure functions while browsing the World Wide Web on desktop computers. There are, however, bytecode compilers available for other languages such as Ada, JavaScript, Python, and Ruby. Several new languages have been designed to run natively on the Java Virtual Machine (JVM), such as Scala, Clojure and Groovy. Java syntax borrows heavily from C and C++, but object-oriented features are modeled after Smalltalk and Objective-C. Java eliminates certain low-level constructs such as pointers and has a very simple memory model where every object is allocated on the heap and all variables of object types are references. Memory management is handled through integrated automatic garbage collection performed by the JVM
8
Java Virtual Machine
The heart of the Java platform is the concept of a "virtual machine" that executes Java bytecode programs. This bytecode is the same no matter what hardware or operating system the program is running under. There is a JIT (Just In Time) compiler within the Java Virtual Machine, or JVM. The JIT compiler translates the Java bytecode into native processor instructions at run-time and caches the native code in memory during execution.
The use of bytecode as an intermediate language permits Java programs to run on any platform that has a virtual machine available. The use of a JIT compiler means that Java applications, after a short delay during loading and once they have "warmed up" by being all or mostly JIT-compiled, tend to run about as fast as native programs.Since JRE version 1.2, Sun's JVM implementation has included a just-in-time compiler instead of an interpreter.
Although Java programs are cross-platform or platform independent, the code of the Java Virtual Machines (JVM) that execute these programs is not. Every supported operating platform has its own JVM.
9
JAVA Swing Application
Swing is a graphical user interface library for the Java SE platform. It is possible to specify a different look and feel through the pluggable look and feel system of Swing. Clones of Windows, GTK+ and Motif are supplied by Sun. Apple also provides an Aqua look and feel for Mac OS X. Where prior implementations of these looks and feels may have been considered lacking, Swing in Java SE 6 addresses this problem by using more native GUI widget drawing routines of the underlying platforms.
This example Swing application creates a single window with "Hello, world!" inside:
import javax.swing.*; public class Hello extends JFrame { public Hello() { super("hello"); super.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); super.add(new JLabel("Hello, world!")); super.pack(); super.setVisible(true); } public static void main(final String[] args) { new Hello(); } }
The first import includes the javax.swing package.
all
of
the
public
classes
and
interfaces
from
The Hello class extends the JFrame class; the JFrame class implements a window with a title bar and a close control.
10
The Hello() constructor initializes the frame by first calling the superclass constructor, passing the parameter "hello", which is used as the window's title. It then calls the setDefaultCloseOperation(int) method inherited from JFrame to set the default operation when the close control on the title bar is selected to WindowConstants.EXIT_ON_CLOSE — this causes the JFrame to be disposed of when the frame is closed (as opposed to merely hidden), which allows the Java virtual machine to exit and the program to terminate. Next, a JLabel is created for the string "Hello, world!" and the add(Component) method inherited from the Containersuperclass is called to add the label to the frame. The pack() method inherited from the Window superclass is called to size the window and lay out its contents.
The main() method is called by the Java virtual machine when the program starts. It instantiates a new Hello frame and causes it to be displayed by calling the setVisible(boolean) method inherited from the Component superclass with the boolean parameter true. Once the frame is displayed, exiting the main method does not cause the program to terminate because the AWT event dispatching thread remains active until all of the Swing top-level windows have been disposed.
11
JAVA Applet
Java applets are programs that are embedded in other applications, typically in a Web page displayed in a Web browser.
import javax.swing.JApplet; import java.awt.Graphics; public class Hello extends JApplet { public void paintComponent(final Graphics g) { g.drawString("Hello, world!", 65, 95); } } The import statements direct the Java compiler to include the javax.swing.JApplet and java.awt.Graphics classes in the compilation. The import statement allows these classes to be referenced in the source code using the simple class name (i.e. JApplet) instead of the fully qualified class name (FQCN, i.e. javax.swing.JApplet).
The Hello class extends (subclasses) the JApplet (Java Applet) class; the JApplet class provides the framework for the host application to display and control the lifecycle of the applet. The JApplet class is a JComponent (Java Graphical Component) which provides the applet with the capability to display a graphical user interface (GUI) and respond to user events.
The Hello class overrides the paintComponent(Graphics) method (additionally indicated with the annotation, supported as of JDK 1.5, Override) inherited from the Container superclass to provide the code to display the applet. The paintComponent() method is passed a Graphics object that contains the graphic context used to display the applet. The paintComponent() method calls the graphic context drawString(String, int, int) method to display the "Hello, world!" string at a pixel offset of (65, 95) from the upper-left corner in the applet's display.
12
Hello World Applet
An applet is placed in an HTML document using the