Академический Документы
Профессиональный Документы
Культура Документы
AIR TICKET
RESERVATION SYSTEM.
Submitted By:
ANIL KUMAR
DOEACC ‘B’ LEVEL PROJECT (PR I)
Registration no: 545482
-1-
Project report-Air Ticket Reservation System
INDEX
3. IMPLEMENTATION AND 21
CODING
Analysis
Data flow diagram 27
-2-
Project report-Air Ticket Reservation System
Data Dictionary 29
Project Development life Cycle
4. DATABASE 90
Flights
Ticket
5. TESTING
6. BIBLOGRAPHY 95
7. CONCLUSION 100
8. LIMITATIONS 102
-3-
Project report-Air Ticket Reservation System
SUBMITTED BY:
ANIL KUMAR
DATE OF SUBBMISSION:
-4-
Project report-Air Ticket Reservation System
-5-
Project report-Air Ticket Reservation System
ACKNOWLEDGEMENT
-6-
Project report-Air Ticket Reservation System
ANIL KUMAR
B-5, SECTOR-5,
HOUSE NO.-185, ROHINI,
NEW DELHI-110 085.
2. Title of Project:
“AIR TICKET RESERVATION SYSTEM”
Date:
-7-
Project report-Air Ticket Reservation System
Executive Director,
DOEACC Society,
6,CGO Complex
Lodhi Road
New Delhi – 110003
Sir,
Level: ‘B’
Address:
(a) Residential Address: B-5, SECTOR-5,
HOUSE NO.-185,
ROHINI,
NEW DELHI-110 085.
-8-
Project report-Air Ticket Reservation System
OBJECTIVE
-9-
Project report-Air Ticket Reservation System
Considering all requirements and time restriction, JAVA is the best answer to
the above problem.
- 10 -
Project report-Air Ticket Reservation System
• It is time consuming.
• It is prone to errors.
- 11 -
Project report-Air Ticket Reservation System
- 12 -
Project report-Air Ticket Reservation System
- 13 -
Project report-Air Ticket Reservation System
HARDWARE USED
SOFTWARE USED
For Front-End
JAVA
For Back-end
MS Access
For connectivity
JAVA
- 14 -
Project report-Air Ticket Reservation System
METHODOLOGY
Project is proceeded according to the steps of SDLC(Software Development Life
Cycle) that is in seven phases which include the following:-
- 15 -
Project report-Air Ticket Reservation System
FRONT-END
It has been coded so as to provide maximum user friendliness and
ease. Stress is laid on the point that the user should enter as type as minimum as
possible. Most of the work is done in few clicks. From each page, jumps to the
other pages are provided.
BACK-END
Database is designed using Ms Access.Our database is “Flight”
“Ticket” required for this application, which contains all flight and ticket
related data.
CONNECTIVITY
A connection string is used to connect the queries written in front-end
codes with the database.
Provider used—sun.jdbc.odbc.JdbcOdbcDriver()
Driver used—Microsoft Access Driver (*mdb).
- 16 -
Project report-Air Ticket Reservation System
- 17 -
Project report-Air Ticket Reservation System
BLOCK DIAGRAM
ALL FLIGHTS
ADD MODIFY DELETE CANCLE RESERV. CANCLE ALL FLIGHT ALL TICKET YES NO
- 18 -
Project report-Air Ticket Reservation System
- 19 -
Project report-Air Ticket Reservation System
PERT CHART
Activity Time
Preliminary Investigation 6 days
Feasibility Study 2 days
System Analysis 3 days
Development of Prototype 6 days
System Design 4 days
Coding 6 days
System Testing 3 days
Implementation & Evaluation 3 days
Maintenance Whole life
Total Days 33 days
- 20 -
Project report-Air Ticket Reservation System
- 21 -
Project report-Air Ticket Reservation System
ANALYSIS
- 22 -
Project report-Air Ticket Reservation System
At this stage, the user’s requirements are determined with the help of
prototyping, asking question and obtaining information from the
existing system.
4.Background Analysis.
Once the project is initiated, the analyst begins to learn about the
setting, the existing system and the physical
- 23 -
Project report-Air Ticket Reservation System
processes related to the revised system. All the background information is
collected and thoroughly studied.
5. Fact Analysis
- 24 -
Project report-Air Ticket Reservation System
1. Initial Investigation
- 25 -
Project report-Air Ticket Reservation System
4. Background Analysis:-
5. Fact Analysis:-
- 26 -
Project report-Air Ticket Reservation System
- 27 -
Project report-Air Ticket Reservation System
LEVEL 0 DFD
LEVEL 0 DFD
- 28 -
Project report-Air Ticket Reservation System
- 29 -
Project report-Air Ticket Reservation System
DATA DICTIONARY
DATATYPE DESCRIPTION
Set Title For giving the name to the window
Set Text For writing the text
ResultSet Rs,
Label Lb1, lb2, lb3, lb4, lb5, lb6, lb7, lb8, lb9, sp1, sp2, sp3, sp4
GridBagLayout Gl
String Str
- 30 -
Project report-Air Ticket Reservation System
Set Visible For defining the visibility
- 31 -
Project report-Air Ticket Reservation System
2. Feasibility phase
3. Definition phase
4. Design phase
5. Implementation phase
6. Maintenance phase
- 32 -
Project report-Air Ticket Reservation System
- 33 -
Project report-Air Ticket Reservation System
import java.sql.*;
import java.awt.*;
import java.awt.event.*;
class air extends Frame implements ActionListener
{
air()
{
MenuBar mb;
Menu mn1,mn2,mn3,mn4;
MenuItem
mi11,mi12,mi21,mi31,mi32,mi33,mi41,mi42;
setTitle("Air Reservation System");
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
mb=new MenuBar();
- 34 -
Project report-Air Ticket Reservation System
setMenuBar(mb);
mn1=new Menu("Masters");
mn2=new Menu("Transaction");
mn3=new Menu("Reports");
mn4=new Menu("Exit");
mb.add(mn1);
mb.add(mn2);
mb.add(mn3);
mb.add(mn4);
mi11=new MenuItem("Flight");
mi21=new
MenuItem("Reservation/Cancelation Ticket");
mi31=new MenuItem("All Flights");
mi32=new MenuItem("All Tickets");
mi41=new MenuItem("Yes");
mi42=new MenuItem("No");
mn1.add(mi11);
mn2.add(mi21);
mn3.add(mi31);
mn3.add(mi32);
mn4.add(mi41);
mn4.add(mi42);
- 35 -
Project report-Air Ticket Reservation System
mi11.addActionListener(this);
mi21.addActionListener(this);
mi31.addActionListener(this);
mi32.addActionListener(this);
mi41.addActionListener(new Exit());
}
class Exit implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
System.exit(0);
}
}
public void actionPerformed(ActionEvent e)
{
if(((MenuItem)
(e.getSource())).getLabel()=="Flight")
{
new flight();
}
- 36 -
Project report-Air Ticket Reservation System
else if(((MenuItem)
(e.getSource())).getLabel()=="Reservation/Cancelat
ion Ticket")
{
new ticket();
}
else if(((MenuItem)
(e.getSource())).getLabel()=="All Flights")
{
new allflight();
}
else if(((MenuItem)
(e.getSource())).getLabel()=="All Tickets")
{
new allticket();
}
}
public static void main(String args[])
{
try
{
- 37 -
Project report-Air Ticket Reservation System
DriverManager.registerDriver(new
sun.jdbc.odbc.JdbcOdbcDriver());
}
catch(Exception e)
{
}
air ar=new air();
ar.setSize(800,600);
ar.setVisible(true);
}
}
Button bt1,bt2,bt3,bt4,bt5,bt6;
- 38 -
Project report-Air Ticket Reservation System
Label lb1,lb2,lb3,lb5,sp1,sp2,sp3,sp4;
GridBagLayout gl;
GridBagConstraints gbc;
flight()
{
setTitle("Flight Master");
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
dispose();
}
});
try
{
cn=DriverManager.getConnection("jdbc:odbc:ai
r");
st=cn.createStatement();
}
catch(Exception e)
{
}
- 39 -
Project report-Air Ticket Reservation System
gl=new GridBagLayout();
gbc=new GridBagConstraints();
setLayout(gl);
lb1=new Label("Enter Flight Code ");
txt1=new TextField(3);
lb2=new Label("Enter Flight Route ");
txt2=new TextField(30);
lb3=new Label("Enter Flight Fare ");
txt3=new TextField(10);
lb5=new Label("Message");
txta=new TextArea(2,30);
sp1=new Label(" ");
sp2=new Label(" ");
sp3=new Label(" ");
sp4=new Label(" ");
bt1=new Button("Add");
bt2=new Button("Modify");
bt3=new Button("Delete");
bt4=new Button("Save");
bt5=new Button("Cancel");
bt6=new Button("Close");
gbc.anchor=GridBagConstraints.NORTHWEST;
- 40 -
Project report-Air Ticket Reservation System
gbc.gridx=0;
gbc.gridy=0;
gl.setConstraints(lb1,gbc);
add(lb1,gbc);
gbc.gridx=1;
gbc.gridy=0;
gl.setConstraints(txt1,gbc);
add(txt1,gbc);
gbc.gridx=0;
gbc.gridy=1;
gl.setConstraints(lb2,gbc);
add(lb2,gbc);
gbc.gridx=1;
gbc.gridy=1;
gl.setConstraints(txt2,gbc);
add(txt2,gbc);
gbc.gridx=0;
gbc.gridy=2;
gl.setConstraints(lb3,gbc);
add(lb3,gbc);
gbc.gridx=1;
- 41 -
Project report-Air Ticket Reservation System
gbc.gridy=2;
gl.setConstraints(txt3,gbc);
add(txt3,gbc);
gbc.gridx=0;
gbc.gridy=3;
gl.setConstraints(sp1,gbc);
add(sp1,gbc);
gbc.gridx=1;
gbc.gridy=3;
gl.setConstraints(sp2,gbc);
add(sp2,gbc);
gbc.gridx=0;
gbc.gridy=4;
gl.setConstraints(bt1,gbc);
add(bt1,gbc);
gbc.gridx=1;
gbc.gridy=4;
gl.setConstraints(bt2,gbc);
add(bt2,gbc);
gbc.gridx=0;
gbc.gridy=5;
gl.setConstraints(bt3,gbc);
- 42 -
Project report-Air Ticket Reservation System
add(bt3,gbc);
gbc.gridx=1;
gbc.gridy=5;
gl.setConstraints(bt4,gbc);
add(bt4,gbc);
gbc.gridx=0;
gbc.gridy=6;
gl.setConstraints(bt5,gbc);
add(bt5,gbc);
gbc.gridx=1;
gbc.gridy=6;
gl.setConstraints(bt6,gbc);
add(bt6,gbc);
gbc.gridx=0;
gbc.gridy=7;
gl.setConstraints(sp3,gbc);
add(sp3,gbc);
gbc.gridx=1;
gbc.gridy=7;
gl.setConstraints(sp4,gbc);
add(sp4,gbc);
gbc.gridx=0;
- 43 -
Project report-Air Ticket Reservation System
gbc.gridy=8;
gl.setConstraints(lb5,gbc);
add(lb5,gbc);
gbc.gridx=1;
gbc.gridy=8;
gl.setConstraints(txta,gbc);
add(txta,gbc);
txta.setEditable(false);
bt1.addActionListener(new BT1());
bt2.addActionListener(new BT2());
bt3.addActionListener(new BT3());
bt4.addActionListener(new BT4());
bt5.addActionListener(new BT5());
bt6.addActionListener(new BT6());
setSize(400,300);
setVisible(true);
}
class BT1 implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
flag="add";
- 44 -
Project report-Air Ticket Reservation System
try
{
rs=st.executeQuery("Select * from flight
where code='" + txt1.getText() + "'");
if(rs.next()==true)
{
txta.setText("Flight Code Allready Exists.");
txt1.requestFocus();
return;
}
else
{
st.executeUpdate("insert into flight values('"
+ txt1.getText() + "','" + txt2.getText() + "'," +
Double.parseDouble(txt3.getText()) + ")");
txt1.setText("");
txt2.setText("");
txt3.setText("");
txta.setText("");
txt1.requestFocus();
- 45 -
Project report-Air Ticket Reservation System
}
}
catch(Exception e1)
{
}
txt1.setText("");
txt2.setText("");
txt3.setText("");
txta.setText("");
txt1.requestFocus();
}
}
class BT2 implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
flag="mod";
String str=txt1.getText();
str=str.trim();
if(str.length()<1 || str.length()>3)
{
- 46 -
Project report-Air Ticket Reservation System
}
- 47 -
Project report-Air Ticket Reservation System
else
{
rs=st.executeQuery("Select * from flight
where code='" + txt1.getText() + "'");
rs.next();
txt1.setText(rs.getString(1));
txt2.setText(rs.getString(2));
txt3.setText(Double.toString(rs.getDouble(3))
);
txta.setText("");
txt1.requestFocus();
code=txt1.getText();
}
}
catch(Exception e1)
{
}
}
}
class BT3 implements ActionListener
{
{
flag="del";
String str=txt1.getText();
str=str.trim();
if(str.length()<1 || str.length()>3)
{
txta.setText("First Enter Flight Code And Must
Be Length Of 1 To 3 Character.");
txt1.requestFocus();
return;
}
try
{
rs=st.executeQuery("Select * from flight where
code='" + txt1.getText() + "'");
if(rs.next()==false)
{
txta.setText("Flight Code Not Found.");
txt1.requestFocus();
}
- 49 -
Project report-Air Ticket Reservation System
- 50 -
Project report-Air Ticket Reservation System
catch(Exception e1)
{
}
}
}
class BT4 implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
String str=txt1.getText();
str=str.trim();
if(str.length()<1 || str.length()>3)
{
txta.setText("Flight Code Must Be Length Of 1
To 3 Character.");
txt1.requestFocus();
return;
}
str=txt2.getText();
str=str.trim();
if(str.length()<1 || str.length()>30)
{
- 51 -
Project report-Air Ticket Reservation System
}
- 52 -
Project report-Air Ticket Reservation System
}
catch(Exception e2)
{
txta.setText("Flight Fare Must Be Numeric
And > 1.");
txt3.requestFocus();
return;
}
if(flag=="add")
{
try
{
rs=st.executeQuery("Select * from flight
where code='" + txt1.getText() + "'");
if(rs.next()==true)
{
txta.setText("Flight Code Allready Exists.");
txt1.requestFocus();
return;
}
else
- 53 -
Project report-Air Ticket Reservation System
{
st.executeUpdate("insert into flight values('"
+ txt1.getText() + "','" + txt2.getText() + "'," +
Double.parseDouble(txt3.getText()) + ")");
txt1.setText("");
txt2.setText("");
txt3.setText("");
txta.setText("");
txt1.requestFocus();
}
}
catch(Exception e1)
{
}
}
else if(flag=="mod")
{
try
{
rs=st.executeQuery("Select * from ticket
where fcode='" + code + "'");
- 54 -
Project report-Air Ticket Reservation System
if(rs.next()==true)
{
txta.setText("Flight Code Is In Use.");
txt1.requestFocus();
return;
}
rs=st.executeQuery("Select * from flight
where code='" + txt1.getText() + "'");
if(rs.next()==true)
{
if(code.compareToIgnoreCase(rs.getString(1
))!=0)
{
txta.setText("Flight Code Allready
Exists.");
txt1.requestFocus();
return;
}
else
{
- 55 -
Project report-Air Ticket Reservation System
txt2.setText("");
- 56 -
Project report-Air Ticket Reservation System
txt3.setText("");
txta.setText("");
txt1.requestFocus();
code="";
}
}
catch(Exception e1)
{
}
}
else if(flag=="del")
{
try
{
rs=st.executeQuery("Select * from ticket
where fcode='" + code + "'");
if(rs.next()==true)
{
txta.setText("Flight Code Is In Use.");
txt1.requestFocus();
return;
}
- 57 -
Project report-Air Ticket Reservation System
- 58 -
Project report-Air Ticket Reservation System
}
}
}
}
class BT5 implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
flag="";
txt1.setText("");
txt2.setText("");
txt3.setText("");
txta.setText("");
txt1.requestFocus();
code="";
}
}
class BT6 implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
dispose();
- 59 -
Project report-Air Ticket Reservation System
}
}
}
{
- 60 -
Project report-Air Ticket Reservation System
- 61 -
Project report-Air Ticket Reservation System
txt2=new TextField(3);
lb3=new Label("Enter Passanger Name ");
txt3=new TextField(20);
lb4=new Label("Enter Others Details ");
txtb=new TextArea(2,50);
lb6=new Label("Enter No. Of Seats ");
txt4=new TextField(2);
lb7=new Label("Enter Passanger Address ");
txt5=new TextField(30);
lb8=new Label("Enter Passanger Phone ");
txt6=new TextField(10);
lb9=new Label("Total Fare ");
txt7=new TextField(10);
lb5=new Label("Message");
txta=new TextArea(2,30);
sp1=new Label(" ");
sp2=new Label(" ");
sp3=new Label(" ");
sp4=new Label(" ");
bt1=new Button("Reservation");
bt2=new Button("Modification");
bt3=new Button("Cancelation");
- 62 -
Project report-Air Ticket Reservation System
bt4=new Button("Save");
bt5=new Button("Cancel");
bt6=new Button("Close");
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=0;
gbc.gridy=0;
gl.setConstraints(lb1,gbc);
add(lb1,gbc);
gbc.gridx=1;
gbc.gridy=0;
gl.setConstraints(txt1,gbc);
add(txt1,gbc);
gbc.gridx=0;
gbc.gridy=1;
gl.setConstraints(lb2,gbc);
add(lb2,gbc);
gbc.gridx=1;
gbc.gridy=1;
gl.setConstraints(txt2,gbc);
add(txt2,gbc);
gbc.gridx=0;
gbc.gridy=2;
- 63 -
Project report-Air Ticket Reservation System
gl.setConstraints(lb3,gbc);
add(lb3,gbc);
gbc.gridx=1;
gbc.gridy=2;
gl.setConstraints(txt3,gbc);
add(txt3,gbc);
gbc.gridx=0;
gbc.gridy=3;
gl.setConstraints(lb4,gbc);
add(lb4,gbc);
gbc.gridx=1;
gbc.gridy=3;
gl.setConstraints(txtb,gbc);
add(txtb,gbc);
gbc.gridx=0;
gbc.gridy=4;
gl.setConstraints(lb6,gbc);
add(lb6,gbc);
gbc.gridx=1;
gbc.gridy=4;
- 64 -
Project report-Air Ticket Reservation System
gl.setConstraints(txt4,gbc);
add(txt4,gbc);
gbc.gridx=0;
gbc.gridy=5;
gl.setConstraints(lb7,gbc);
add(lb7,gbc);
gbc.gridx=1;
gbc.gridy=5;
gl.setConstraints(txt5,gbc);
add(txt5,gbc);
gbc.gridx=0;
gbc.gridy=6;
gl.setConstraints(lb8,gbc);
add(lb8,gbc);
gbc.gridx=1;
gbc.gridy=6;
gl.setConstraints(txt6,gbc);
add(txt6,gbc);
gbc.gridx=0;
gbc.gridy=7;
gl.setConstraints(lb9,gbc);
add(lb9,gbc);
- 65 -
Project report-Air Ticket Reservation System
gbc.gridx=1;
gbc.gridy=7;
gl.setConstraints(txt7,gbc);
add(txt7,gbc);
gbc.gridx=0;
gbc.gridy=8;
gl.setConstraints(sp1,gbc);
add(sp1,gbc);
gbc.gridx=1;
gbc.gridy=8;
gl.setConstraints(sp2,gbc);
add(sp2,gbc);
gbc.gridx=0;
gbc.gridy=9;
gl.setConstraints(bt1,gbc);
add(bt1,gbc);
gbc.gridx=1;
gbc.gridy=9;
gl.setConstraints(bt2,gbc);
add(bt2,gbc);
gbc.gridx=0;
gbc.gridy=10;
- 66 -
Project report-Air Ticket Reservation System
gl.setConstraints(bt3,gbc);
add(bt3,gbc);
gbc.gridx=1;
gbc.gridy=10;
gl.setConstraints(bt4,gbc);
add(bt4,gbc);
gbc.gridx=0;
gbc.gridy=11;
gl.setConstraints(bt5,gbc);
add(bt5,gbc);
gbc.gridx=1;
gbc.gridy=11;
gl.setConstraints(bt6,gbc);
add(bt6,gbc);
gbc.gridx=0;
gbc.gridy=12;
gl.setConstraints(sp3,gbc);
add(sp3,gbc);
gbc.gridx=1;
gbc.gridy=12;
gl.setConstraints(sp4,gbc);
add(sp4,gbc);
- 67 -
Project report-Air Ticket Reservation System
gbc.gridx=0;
gbc.gridy=13;
gl.setConstraints(lb5,gbc);
add(lb5,gbc);
gbc.gridx=1;
gbc.gridy=13;
gl.setConstraints(txta,gbc);
add(txta,gbc);
txta.setEditable(false);
bt1.addActionListener(new BT1());
bt2.addActionListener(new BT2());
bt3.addActionListener(new BT3());
bt4.addActionListener(new BT4());
bt5.addActionListener(new BT5());
bt6.addActionListener(new BT6());
txt7.setEditable(false);
setSize(600,500);
setVisible(true);
}
class BT1 implements ActionListener
{
{
flag="add";
try
{
rs=st.executeQuery("Select max(code) as no
from ticket");
rs.next();
code=Long.toString(rs.getLong(1) + 1);
}
catch(Exception e1)
{
}
txt1.setText(code);
txt2.setText("");
txt3.setText("");
txt4.setText("");
txt5.setText("");
txt6.setText("");
txt7.setText("");
txtb.setText("");
txta.setText("");
txt1.setEditable(false);
- 69 -
Project report-Air Ticket Reservation System
txt2.requestFocus();
}
}
class BT2 implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
flag="mod";
String str=txt1.getText();
str=str.trim();
if(str.length()<1 || str.length()>5)
{
txta.setText("First Enter Ticket No. And Must
Be Length Of 1 To 5 Numeric Digits.");
txt1.requestFocus();
return;
}
try
{
if(Long.parseLong(str)<1)
{
- 70 -
Project report-Air Ticket Reservation System
- 71 -
Project report-Air Ticket Reservation System
else
{
txt1.setText(Long.toString(rs.getLong(1)));
txt2.setText(rs.getString(2));
txt3.setText(rs.getString(3));
txtb.setText(rs.getString(4));
txt4.setText(Integer.toString(rs.getInt(5)));
txt5.setText(rs.getString(6));
txt6.setText(rs.getString(7));
txt7.setText(Double.toString(rs.getDouble(8))
);
txta.setText("");
txt1.setEditable(false);
txt2.requestFocus();
code=txt1.getText();
}
}
catch(Exception e1)
{
}
}
- 72 -
Project report-Air Ticket Reservation System
}
class BT3 implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
flag="del";
String str=txt1.getText();
str=str.trim();
if(str.length()<1 || str.length()>5)
{
txta.setText("First Enter Ticket No. And Must
Be Length Of 1 To 5 Numeric Digits.");
txt1.requestFocus();
return;
}
try
{
if(Long.parseLong(str)<1)
{
txta.setText("Ticket No. Must Be Numeric
And > 1.");
txt1.requestFocus();
- 73 -
Project report-Air Ticket Reservation System
return;
}
}
catch(Exception e2)
{
txta.setText("Ticket No. Must Be Numeric
And > 1.");
txt1.requestFocus();
return;
}
try
{
rs=st.executeQuery("Select * from ticket
where code=" + txt1.getText());
if(rs.next()==false)
{
txta.setText("Ticket No. Not Found.");
txt1.requestFocus();
}
else
{
txt1.setText(Long.toString(rs.getLong(1)));
- 74 -
Project report-Air Ticket Reservation System
txt2.setText(rs.getString(2));
txt3.setText(rs.getString(3));
txtb.setText(rs.getString(4));
xt4.setText(Integer.toString(rs.getInt(5)));
txt5.setText(rs.getString(6));
txt6.setText(rs.getString(7));
txt7.setText(Double.toString(rs.getDouble(8)
));
txta.setText("");
txt1.setEditable(false);
txt2.requestFocus();
code=txt1.getText();
}
}
catch(Exception e1)
{
}
}
}
class BT4 implements ActionListener
{
public void actionPerformed(ActionEvent e)
- 75 -
Project report-Air Ticket Reservation System
{
String str;
str=txt2.getText();
str=str.trim();
if(str.length()<1 || str.length()>3)
{
txta.setText("Flight Code Must Be Length Of 1
To 3 Character.");
txt2.requestFocus();
return;
}
try
{
rs=st.executeQuery("Select fare from flight
where code='" + txt2.getText() + "'");
if(rs.next()==false)
{
txta.setText("Flight Code Not Found.");
txt2.requestFocus();
return;
}
else
- 76 -
Project report-Air Ticket Reservation System
{
fare=Double.toString(rs.getDouble(1));
}
}
catch(Exception e1)
{
}
str=txt3.getText();
str=str.trim();
if(str.length()<1 || str.length()>20)
{
txta.setText("Passanger Name Must Be Length
Of 1 To 20 Character.");
txt3.requestFocus();
return;
}
str=txtb.getText();
str=str.trim();
if(str.length()>100)
{
txta.setText("Other Details Can Be Length Of
0 To 100 Character.");
- 77 -
Project report-Air Ticket Reservation System
txtb.requestFocus();
return;
}
str=txt4.getText();
str=str.trim();
if(str.length()<1 || str.length()>2)
{
txta.setText("No. Of Seats Must Be Length Of
1 To 2 Numeric Digits.");
txt4.requestFocus();
return;
}
try
{
if(Integer.parseInt(str)<1)
{
txta.setText("No. Of Seats Must Be Numeric
And > 1.");
txt4.requestFocus();
return;
}
}
- 78 -
Project report-Air Ticket Reservation System
catch(Exception e2)
{
txta.setText("No. Of Seats Must Be Numeric
And > 1.");
txt4.requestFocus();
return;
}
str=txt5.getText();
str=str.trim();
if(str.length()<1 || str.length()>30)
{
txta.setText("Passanger Address Must Be
Length Of 1 To 30 Character.");
txt5.requestFocus();
return;
}
str=txt6.getText();
str=str.trim();
if(str.length()>10)
{
txta.setText("Passanger Phone Can Be Length
Of 0 To 10 Character.");
- 79 -
Project report-Air Ticket Reservation System
txt6.requestFocus();
return;
}
if(flag=="add") /* save after add */
{
try
{
txt7.setText(Double.toString(Double.parseDo
uble(fare)*Double.parseDouble(txt4.getText())));
Integer.parseInt(txt4.getText()) + ",'" +
txt5.getText() + "','" + txt6.getText() + "'," +
Double.parseDouble(txt7.getText()) + ")");
txt1.setText("");
txt2.setText("");
txt3.setText("");
- 80 -
Project report-Air Ticket Reservation System
txt4.setText("");
txt5.setText("");
txt6.setText("");
txt7.setText("");
txtb.setText("");
txta.setText("");
txt1.setEditable(true);
txt1.requestFocus();
}
catch(Exception e1)
{
}
}
else if(flag=="mod") /* save after modify */
{
try
{
txt7.setText(Double.toString(Double.parseDo
uble(fare)*Double.parseDouble(txt4.getText())));
- 81 -
Project report-Air Ticket Reservation System
catch(Exception e1)
{
}
- 82 -
Project report-Air Ticket Reservation System
}
else if(flag=="del") /* save after delete */
{
try
{
st.executeUpdate("Delete * from ticket where
code=" + Long.parseLong(txt1.getText()));
txt1.setText("");
txt2.setText("");
txt3.setText("");
txt4.setText("");
txt5.setText("");
txt6.setText("");
txt7.setText("");
txtb.setText("");
txta.setText("");
txt1.setEditable(true);
txt1.requestFocus();
}
catch(Exception e1)
- 83 -
Project report-Air Ticket Reservation System
{
}
}
}
}
class BT5 implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
flag="";
txt1.setText("");
txt2.setText("");
txt3.setText("");
txt4.setText("");
txt5.setText("");
txt6.setText("");
txt7.setText("");
txtb.setText("");
txta.setText("");
txt1.setEditable(true);
txt1.requestFocus();
code="";
- 84 -
Project report-Air Ticket Reservation System
}
}
class BT6 implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
dispose();
}
}
}
setTitle("All Flights");
addWindowListener(new WindowAdapter()
{
- 85 -
Project report-Air Ticket Reservation System
catch(Exception e)
{
}
add(txta);
setSize(400,300);
setVisible(true);
}
}
addWindowListener(new WindowAdapter()
{
- 87 -
Project report-Air Ticket Reservation System
- 88 -
Project report-Air Ticket Reservation System
- 89 -
Project report-Air Ticket Reservation System
- 90 -
Project report-Air Ticket Reservation System
FLIGHT
- 91 -
Project report-Air Ticket Reservation System
- 92 -
Project report-Air Ticket Reservation System
- 93 -
Project report-Air Ticket Reservation System
TICKET
Code Fcode Name Others Seats Address Phone Fare
1 002 NARIANDER ASHISH 6 vips 23257824 42000
2 009 vibhu mishra sunil 2 DFWEQF 22911559 24000
3 001 amit goel asdhjsa 2 addfa 8948 14000
4 004 GAURAV ANKIT 5 2032 32497675 5550
5 003 AMAN VAIBHAV 1 GALI 23269153 5972
6 005 SIDDHANT TARANG 3 VCXZ 9350767675 6102
7 007 SAGAR HARSH 8 JDGC 23255654 6541
8 011 AYUISH SHOBHIT 4 LKERUF 23266548 5470
9 021 ANUJ JATIN 10 YTSX 23254678 9874
10 012 YASH ADDI 10 JGYD0 23248795 9870
11 045 RAHUL ROHIT 12 JHGD 32461216 6871
12 015 SUNIL SACHIN 7 JGXD 23259784 6879
13 019 AKSHAT SONU 7 JYFD 23252631 9456
14 08 sita gita 9 rfs 23259971 5645
15 032 pyuish sukhjeet 24 kfhkovx 2367039 6481
16 031 neha siddharth 5 abcd 23257824 7500
- 94 -
Project report-Air Ticket Reservation System
- 95 -
Project report-Air Ticket Reservation System
TESTING PHASE
Testing is the process of making sure that the programs perform the
intended tasks. Once the system is designed it should be tested for
validity. During system testing, the system is used experimentally to
insure that the software does not fail, that means it will run according
to its specification and in the way users expect it to. The system is
tested with special test data and the results are examined for their
validity. Some of the users may be permitted to operate on the system
so that the analyst can ascertain that the system can work in the
specified environment.
- 96 -
Project report-Air Ticket Reservation System
IMPLEMENTATION PHASE
- 97 -
Project report-Air Ticket Reservation System
MAINTENANCE PHASE
- 98 -
Project report-Air Ticket Reservation System
- 99 -
Project report-Air Ticket Reservation System
CONCLUSION
- 100 -
Project report-Air Ticket Reservation System
LIMITATION
- 101 -
Project report-Air Ticket Reservation System
FUTURE ENHANCEMENTS
- 102 -
Project report-Air Ticket Reservation System
REFERENCE
Web site-:
• sunmicrosoft.com
• doeacc.edu
Books-:
- 103 -
Project report-Air Ticket Reservation System
- 104 -
Project report-Air Ticket Reservation System
- 105 -
Project report-Air Ticket Reservation System
- 106 -
Project report-Air Ticket Reservation System
- 107 -
Project report-Air Ticket Reservation System
- 108 -
Project report-Air Ticket Reservation System
- 109 -
Project report-Air Ticket Reservation System
- 110 -