• 大小: 1.31M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-08-10
  • 语言: 其他
  • 标签: 其他  

资源简介

1373860航空订票系统.rar

资源截图

代码片段和文件信息

package flight.assist;

import flight.assist.*;

import javax.swing.*;
import java.io.*;
import java.sql.*;

public class SeatInfo
{
        private SqlBean sqlBean = new SqlBean();
        private RandomAccessFile raf;
        private final int FLIGHT_PER_DAY = 10;

        public SeatInfo()
        {
            File file=new File(“.““data“);
                file.mkdir();
                File f = new File(file“SeatInfo.txt“);

                try
                {
                        raf = new RandomAccessFile(f“rw“);

                        if (raf.length() == 0)
                        {
                                raf.setLength(31 * 4 * FLIGHT_PER_DAY);
                                for (int i = 0 ; i < 31 * FLIGHT_PER_DAY;i++)
                               raf.writeInt(0);
                        }
                }
                catch(Exception e)
                {
                        e.printStackTrace();
                }

        }

        public boolean isFull(String flightNumString day)
        {
            try
            {
                     long index = cacuIndex(day);
                    long address = cacuAddr(flightNum);
                    long absoluteAddress = index + address;

                    raf.seek(absoluteAddress);
                    int bookedSeats = raf.readInt();
                       String sqlString = “select seat from flight where flight=‘“ + flightNum + “‘“;
                        ResultSet rs = sqlBean.executeQuery(sqlString);

                        int totalSeats = 0;

                        while (rs.next())
                                totalSeats = rs.getInt(1);
                        if (totalSeats == bookedSeats)
                           return true;
                        else
                           return false;

            }
            catch(Exception e)
            {
                       return false;
            }
        }

        public int dingPiao(String flightNumString dayint seats)
        {
                int leftSeats = 0;
                try
            {
                    long index = cacuIndex(day);
                    long address = cacuAddr(flightNum);
                    long absoluteAddress = index + address;

                    raf.seek(absoluteAddress);
                    int bookedSeats = raf.readInt();

                    String sqlString = “select seatweek from flight where flight=‘“ + flightNum + “‘ “;
                        ResultSet rs = sqlBean.executeQuery(sqlString);

                        int totalSeats = 0;
                        String week=““;
                        while (rs.next())
                           {
                                   totalSeats = rs.getInt(1);
                                   week=rs.getString(2);
                           }

                        String c=isAbsence(day);
                    int flag=0;
                        for(int i=0;i                

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       5637  2009-09-13 09:18  航空订票系统\flight\build\classes\flight\assist\SeatInfo.class

     文件       2399  2009-09-13 09:18  航空订票系统\flight\build\classes\flight\assist\SqlBean.class

     文件       3434  2009-09-13 09:18  航空订票系统\flight\build\classes\flight\assist\UpdateComboBox.class

     文件      12019  2009-09-13 09:18  航空订票系统\flight\build\classes\flight\dingpiao\Client.class

     文件        707  2009-09-13 09:18  航空订票系统\flight\build\classes\flight\dingpiao\Hangkong$1.class

     文件      18147  2009-09-13 09:18  航空订票系统\flight\build\classes\flight\dingpiao\Hangkong.class

     文件       1309  2009-09-13 09:18  航空订票系统\flight\build\classes\flight\dingpiao\writeToFile.class

     文件       4182  2009-09-13 09:18  航空订票系统\flight\build\classes\flight\Main\CheckID.class

     文件        995  2009-09-13 09:18  航空订票系统\flight\build\classes\flight\Main\Interface.class

     文件       5352  2009-09-13 09:18  航空订票系统\flight\build\classes\flight\Main\Main.class

     文件       2769  2009-09-13 09:18  航空订票系统\flight\build\classes\flight\manage\DeletePanel$1.class

     文件       9405  2009-09-13 09:18  航空订票系统\flight\build\classes\flight\manage\DeletePanel.class

     文件       4354  2009-09-13 09:18  航空订票系统\flight\build\classes\flight\manage\InsertPanel$1.class

     文件       5763  2009-09-13 09:18  航空订票系统\flight\build\classes\flight\manage\InsertPanel.class

     文件       5154  2009-09-13 09:18  航空订票系统\flight\build\classes\flight\manage\Show.class

     文件        685  2009-09-13 09:18  航空订票系统\flight\build\classes\flight\manage\TestDB$1.class

     文件       1307  2009-09-13 09:18  航空订票系统\flight\build\classes\flight\manage\TestDB.class

     文件       7736  2009-09-13 09:18  航空订票系统\flight\build\classes\flight\manage\UpdatePanel.class

     文件       5645  2009-09-13 09:18  航空订票系统\flight\build\classes\flight\query\AirFirmQuery.class

     文件       9262  2009-09-13 09:18  航空订票系统\flight\build\classes\flight\query\CommonQuery.class

     文件       2184  2009-09-13 09:18  航空订票系统\flight\build\classes\flight\query\ComprehenQuery$RadioListener.class

     文件      19025  2009-09-13 09:18  航空订票系统\flight\build\classes\flight\query\ComprehenQuery.class

     文件       7069  2009-09-13 09:18  航空订票系统\flight\build\classes\flight\query\DestinQuery.class

     文件       6520  2009-09-13 09:18  航空订票系统\flight\build\classes\flight\query\FlightQuery.class

     文件        686  2009-09-13 09:18  航空订票系统\flight\build\classes\flight\query\MyQuery$1.class

     文件       2369  2009-09-13 09:18  航空订票系统\flight\build\classes\flight\query\MyQuery.class

     文件        696  2009-09-13 09:18  航空订票系统\flight\build\classes\flight\tuipiao\TuiPiao$1.class

     文件      14202  2009-09-13 09:18  航空订票系统\flight\build\classes\flight\tuipiao\TuiPiao.class

     文件       3355  2009-08-18 18:57  航空订票系统\flight\build.xml

     文件         93  2009-08-18 19:33  航空订票系统\flight\data\ClientInfo.txt

............此处省略69个文件信息

评论

共有 条评论