air ticket reservation system full report
#9
[attachment=15571]
Code:
import java.sql.*;
import java.awt.*;
import java.awt.event.*;

public class Cancellation extends Frame implements ActionListener
{
        Label l1,l2,l3;
    TextField t1;
        
    Button b1,b2;
    GridBagLayout gbl;
    GridBagConstraints gbc;
        Connection con;
        PreparedStatement ps;
        Statement stmt;
    ResultSet rs;
    int count;
    Font f;
    




    Cancellation()
{
         setBackground(Color.cyan);
         f = new Font("TimesRoman",Font.BOLD,20);
         gbl=new GridBagLayout();
     gbc=new GridBagConstraints();
     setLayout(gbl);
    
         l1 = new Label("PNR No");
     l1.setFont(f);
        
         t1 = new TextField(20);
        
         l2 = new Label("");
     l3 = new Label("");
          
         b1 = new Button("Submit");
     b2 = new Button("Reset");

         gbc.gridx=0;
     gbc.gridy=0;
     gbl.setConstraints(l1,gbc);
     add(l1);

         gbc.gridx=2;
     gbc.gridy=0;
     gbl.setConstraints(t1,gbc);
     add(t1);

         gbc.gridx=0;
     gbc.gridy=2;
     gbl.setConstraints(l2,gbc);
     add(l2);

         gbc.gridx=2;
     gbc.gridy=2;
     gbl.setConstraints(l3,gbc);
     add(l3);

         gbc.gridx=0;
     gbc.gridy=4;
     gbl.setConstraints(b1,gbc);
     add(b1);

         gbc.gridx=2;
     gbc.gridy=4;
     gbl.setConstraints(b2,gbc);
     add(b2);

         b1.addActionListener(this);
     b2.addActionListener(this);
         addWindowListener(new TU());
}
        public void actionPerformed(ActionEvent ae)
    {
        
        if(ae.getSource()==b2)
    {
         t1.setText("");
        }
        
      
        if(ae.getSource()==b1)
    {
    try
    {  
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        con=DriverManager.getConnection("jdbc:odbc:MyDataSource1");
        
        ps=con.prepareStatement("select FlightNo,TravelDate,Class from Passengers where PNRNo=?");
        String pnrno = t1.getText();
        ps.setInt(1,Integer.parseInt(pnrno));
        rs=ps.executeQuery();
        rs.next();
        
        System.out.println(rs.getString(1)+""+rs.getString(2)+" "+rs.getString(3));          
        
        

        
        

      
  /*      if(rs.getString(3).equals(String.valueOf('F')))
        {
      
        
        ps=con.prepareStatement("update Reservation set FSeats=FSeats+1 where FlightNo=? and TravelDate=?");
        ps.setString(1,rs.getString(1));
        ps.setString(2,rs.getString(2));
        count=ps.executeUpdate();
        
        }  

      if(rs.getString(3).equals(String.valueOf('B')))
        {
        
        
        ps=con.prepareStatement("update Reservation set BSeats=BSeats+1 where FlightNo= ? and TravelDate= ? ");
        ps.setString(1,rs.getString(1));
        ps.setString(2,rs.getString(2));
        count=ps.executeUpdate();
      
        }


       if(rs.getString(3).equals(String.valueOf('E')))
        {
        
      
        ps=con.prepareStatement("update Reservation set ESeats=ESeats+1 where FlightNo=? and TravelDate=?");
        ps.setString(1,rs.getString(1));
        ps.setString(2,rs.getString(2));
        count=ps.executeUpdate();
        
        }
        
*/
    
        ps=con.prepareStatement("delete from Passengers where PNRNo=?");
        ps.setInt(1,Integer.parseInt(pnrno));
        count = ps.executeUpdate();  
        con.close();
        t1.setText("");


        }
        
        catch(Exception e)
        {
        System.out.println("Error : "+e);
        }
        
        }

        }
    
        class TU extends WindowAdapter
    {
    public void windowClosing(WindowEvent e)
    {
    setVisible(false);
    dispose();
            
    }
    }

}
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: dom kulture, ticket reservation system project report, reservation system, reservation, sitemap bing, ieee paper on ticket reservation, air reservation,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Messages In This Thread
RE: air ticket reservation system full report - by smart paper boy - 30-08-2011, 02:51 PM
I have a deal for you. - by RaymondGom - 08-01-2018, 02:33 PM

Possibly Related Threads...
Thread Author Replies Views Last Post
  SAMBA SERVER ADMINISTRATION full report project report tiger 3 4,780 17-01-2018, 05:40 PM
Last Post: AustinnuAke
  An Efficient Algorithm for Mining Frequent Patterns full report project topics 3 4,806 01-10-2016, 10:02 AM
Last Post: Guest
  online examination full report project report tiger 14 42,960 03-09-2016, 11:20 AM
Last Post: jaseela123d
  Online Ticket Reservation System for Cinema Halls Electrical Fan 16 19,406 04-07-2016, 03:10 PM
Last Post: visalakshik
  Employee Cubicle Management System full report computer science technology 4 5,148 07-04-2016, 11:37 AM
Last Post: dhanabhagya
  e-Post Office System full report computer science technology 27 26,139 30-03-2016, 02:56 PM
Last Post: dhanabhagya
  ONLINE TICKET BOOKING SYSTEM FOR PVR CINEMAS seminar class 9 14,653 25-01-2016, 01:20 PM
Last Post: Guest
  college website project full report project report tiger 28 67,400 29-11-2015, 02:37 PM
Last Post: Guest
  RAILWAY TICKET SYSTEM computer science technology 6 18,696 24-07-2015, 02:31 PM
Last Post: seminar report asees
  steganography full report project report tiger 31 34,111 07-07-2015, 02:57 PM
Last Post: seminar report asees

Forum Jump: