亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? comprehenquery.java

?? 歡迎使用航空訂售票系統(tǒng) 還有很多不足之處望大家諒解
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
    	   return false;
    }    
    
       //The method used to turn the designate day into the weekday
       //Like turn "2004,12,25" into 6(Saturday)
    private String timeToWeek(String year,String month,String day)
    {
       int sum=0;
       int y = Integer.parseInt(year);
       int m = Integer.parseInt(month);
       int d = Integer.parseInt(day);
              
       int[] dayOfMonth = {0,31,28,31,30,31,30,31,31,30,31,30,31};  
      
          //Caculate the first the day of the designate year is "Xing Qi Ji"
       int firstDayOfYear = firstDay(y);
            
       for(int i = 1;i < m;i++)
        {
           sum=sum+dayOfMonth[i];
        }
      
       sum = sum+(d-1)+firstDayOfYear;

          //If month is over February and the designate year is leap year,
          //the total days should be add one 
       if( (m >= 2) && ((y%4 == 0 && y%100 != 0) || (y%400 == 0)))
          sum ++;
          
       int week = 0;  
          //The weekday for the designate day is: 
       int x = sum % 7;       
       switch(x)
         {
          case 1:
             week = 1;
             break;            
          case 2:
             week = 2;
             break;
          case 3:
             week = 3;
             break;
          case 4:
             week = 4;
             break;
          case 5:
             week = 5;
             break;
          case 6:
             week = 6;
             break;
          case 0:
             week = 7;
             break;
         } 
         
       return String.valueOf(week);                  	    
    }
    
       //The method used to caculate the first the day of the designate year is "Xing Qi Ji"
    private int firstDay(int year)
    {
    	int a,b;
    	
	    if(year <= 2000)
	    {
	        a=2000-year;
	        b=6-(a+a/4-a/100+a/400)%7;
	        return b;
	    }
	    else 
	    {
	        a=year-2000;
	        b=(a+1+(a-1)/4-(a-1)/100+(a-1)/400)%7+6;
	        return b%7;
	    }
    }
    
       //The query method for the one way query mode
    public void executeSingleQuery()
    {
    	String sqlString = formSQLString(start,arrive);    	   
    	         
        ResultSet rs = sqlBean.executeQuery(sqlString);
        
        if (rs != null)
	    {
		       //Form result string
	        String result = "                                                    " + 
			                "綜合查詢"; 
			   //Form the specific result string according the message you give       
	        result += formResult(rs,leaveYear,leaveMonth,leaveDay,leaveWeek,start,arrive);    	
	        
	           //Display result in a dialog
	        showResult(result);
	    }	       
	    else 
	       JOptionPane.showMessageDialog(null,"沒有連接上數(shù)據(jù)庫!",
	                                    "錯誤信息",JOptionPane.ERROR_MESSAGE);           
    }
    
       //The query method for the out and home way query mode
    public void executeDoubleQuery()
    {
    	   //The out and home way has to query the database two times to find the 
    	   //flight infomation of from start city to destination and from destination to start city
    	String sqlString1 = formSQLString(start,arrive);        
        ResultSet rs1 = sqlBean.executeQuery(sqlString1);
        
        String sqlString2 = formSQLString(arrive,start);    	         
        ResultSet rs2 = sqlBean.executeQuery(sqlString2);
        
        if ( (rs1 != null) || (rs2 != null))
	    {
	    	String result = "                                                  " + 
		                    "綜合查詢 ";
			   //Form the result string for the out and home way query mode              
	        result += formDoubleResult(rs1,rs2);    	
	        
	        showResult(result);
	    }
	    else 
	       JOptionPane.showMessageDialog(null,"沒有連接上數(shù)據(jù)庫!",
	                                    "錯誤信息",JOptionPane.ERROR_MESSAGE);       
    }
    
       //The query method for the mutiple way query mode
    public void executeMutipleQuery()
    {
    	   //The out and home way has to query the database two times to find the 
    	   //flight infomation of from start city to midway destination 
    	   //and from midway destination to final destination
    	String sqlString1 = formSQLString(start,firstArrive);  	         
        ResultSet rs1 = sqlBean.executeQuery(sqlString1);
        
        String sqlString2 = formSQLString(firstArrive,arrive); 	         
        ResultSet rs2 = sqlBean.executeQuery(sqlString2);
        
        if ((rs1 != null) || (rs2 != null))
	    {
	    	String result = "                                                               " + 
		                    "綜合查詢                                                 ";
			   //Form the result string for the mutiple way query mode
	        result += formMutipleResult(rs1,rs2);    	
	        
	        showResult(result);
	    }
	    else 
	       JOptionPane.showMessageDialog(null,"沒有連接上數(shù)據(jù)庫!",
	                                    "錯誤信息",JOptionPane.ERROR_MESSAGE);        
    }
    
    public String formSQLString(String begin,String end)
    {
    	String sqlString = "SELECT DISTINCT * FROM " + "flight " +    	
						   "WHERE start=" + "\'" + begin + "\'" + " AND " +
			               "destination=" + "\'" + end + "\'";			           	
    	                
    	if (!airFirm.equals("所有"))
    	   sqlString += " AND " + "airFirm=" + "\'" + airFirm + "\'";
    	   
    	return sqlString;
    }
    
       //Get the result string from the result set
    public String formResult(ResultSet rs,String year,String month,String day,
                                          String week,String begin,String end)
    {		
		String result = "";
		   //Change the English weekday into the chinese weekday
		String weekDay = dayOfWeek(week);
		
		result += "\n" + "航程:" + year + "年" + month + "月" + day + "日" +	
		          "(星期" + weekDay + ")  " + begin + "----" + end + "\n"; 
		                  
		result += "航班號    航空公司            起飛地點  抵達地點  起飛時間  抵達時間  " + 
		          "兒童票價   成人票價   折扣   班期 " + "\n";
		     
		   //Used to determine whether there are no records found          
		int originLength = result.length();
		
		String time1,time2;
		String childFare,adultFare,discount1,discount2,seat;
		
		try
		{	
		    String tempResult = "";
		    String tempWeek;
			while(rs.next())
			{			
				tempResult = rs.getString("flight") + rs.getString("airfirm") + rs.getString("start") + 
				             rs.getString("destination");
				             
				   //When you get the time from the resultset,it is like "1200".
				   //So we should change it into the form "12:00".
				time1 = rs.getString("leaveTime");
				time2 = rs.getString("arriveTime");
				   //getTime(String time) is used to change the time form into standard one
				time1 = getTime(time1);
				time2 = getTime(time2);
				
				tempResult += time1 + "     " + time2  + "     ";
				
				   //Make sure that the following items have the exactly bits,
				   //so that they can be display in a neat format	
				childFare = String.valueOf(rs.getFloat("childFare"));
				adultFare = String.valueOf(rs.getFloat("adultFare"));
				discount1 = String.valueOf(rs.getFloat("discount1"));
				discount2 = String.valueOf(rs.getFloat("discount2"));
				seat = String.valueOf(rs.getInt("seat"));
				
				   //Make every item in a neat format
				while(childFare.length() != 11)
				   childFare += " ";
				while(adultFare.length() != 11)
				   adultFare += " ";
				while(discount1.length() != 8)
				   discount1 += " ";						
				   
				tempWeek = rs.getString("week");
		        tempResult += childFare + adultFare + discount1 +
				              tempWeek;
				tempResult += "\n";
				
				   //If the flight schedule contains the day that the user designate,
				   //the record is the just one we find!So put the tempResult to the result!
				   //If not,it is not the result!So can't put the tempResult to the result!
				if (tempWeek.indexOf(week) != -1)
				   result += tempResult;							
			}
		}
		catch(SQLException e)
		{
			e.printStackTrace();
		}
		
		   //Means there are no records found
		   //So give user message that couldn't find correlate infomation
		if (result.length() == originLength)
		{
			result += "                                                    " +
			          "對不起,找不到你想要的航班信息!" + "\n";
		}	
		
		return result;
    } 
    
       //The method used to change the time form 
    private String getTime(String time)
	{
		String time1,time2;
		time1 = time.substring(0,2);
		time2 = time.substring(2,4);
		
		time1 = time1.concat(":");
		time1 = time1.concat(time2);
		
		return time1;
	}
	 
       //The method used to change the English weekday into the chinese weekday
    private String dayOfWeek(String weekNum)
    {
    	String week = "";
    	int num = Integer.parseInt(weekNum);
    	
		switch(num)
		{
			case 1:
             week = "一";
             break;            
          case 2:
             week = "二";
             break;
          case 3:
             week = "三";
             break;
          case 4:
             week = "四";
             break;
          case 5:
             week = "五";
             break;
          case 6:
             week = "六";
             break;
          case 7:
             week = "日";
             break;
		}
		
		return week;
    }   
    
       //Form the result string for the out and home way query mode 
    public String formDoubleResult(ResultSet rs1,ResultSet rs2)
    {
    	String result1 = formResult(rs1,leaveYear,leaveMonth,leaveDay,leaveWeek,start,arrive);
    	String result2 = formResult(rs2,backYear,backMonth,backDay,backWeek,arrive,start);
    	
    	String result = result1 + result2;
    	return result;
    }
    
       //Form the result string for the mutiple way query mode
    public String formMutipleResult(ResultSet rs1,ResultSet rs2)
    {
    	String result1 = formResult(rs1,leaveYear,leaveMonth,leaveDay,leaveWeek,start,firstArrive);
    	String result2 = formResult(rs2,leaveYear2,leaveMonth2,leaveDay2,leaveWeek2,firstArrive,arrive);
    	
    	String result = result1 + result2;
    	return result;
    }
    
       //Show the result in a dialog
    public void showResult(String result)
    {
    	JOptionPane.showMessageDialog(null,result,"查詢結(jié)果",JOptionPane.PLAIN_MESSAGE);
    }         
}///:~

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99久久夜色精品国产网站| 日韩精品资源二区在线| 国产乱淫av一区二区三区 | 亚洲aⅴ怡春院| 91视频免费播放| 亚洲乱码一区二区三区在线观看| 成人性色生活片| 中文成人综合网| 99re成人在线| 亚洲国产日日夜夜| 日韩亚洲欧美高清| 国产一区日韩二区欧美三区| 亚洲欧美激情小说另类| 欧洲国内综合视频| 丝袜美腿亚洲一区二区图片| 欧美一区二区精品久久911| 久久精品99国产精品日本| 久久―日本道色综合久久| 99久久99久久免费精品蜜臀| 亚洲一线二线三线视频| 欧美一区二区三区播放老司机| 七七婷婷婷婷精品国产| 久久久久久久久伊人| 色婷婷久久一区二区三区麻豆| 香蕉影视欧美成人| 久久久久久久久久久久久夜| 99久久精品国产精品久久| 性久久久久久久久久久久| 欧美电影免费观看高清完整版在线观看| 狠狠色丁香婷综合久久| 天天av天天翘天天综合网| 亚洲欧洲99久久| 99re热视频这里只精品| 亚洲国产欧美一区二区三区丁香婷 | 欧美顶级少妇做爰| 国产在线精品免费av| 亚洲精品国产一区二区三区四区在线| 欧美区在线观看| 成人免费黄色在线| 青椒成人免费视频| 亚洲欧美aⅴ...| wwwwww.欧美系列| 欧美性猛交xxxx乱大交退制版| 国内精品免费**视频| 亚洲一区二区美女| 久久精品夜夜夜夜久久| 欧美日韩国产大片| gogogo免费视频观看亚洲一| 日本不卡一区二区| 亚洲精选视频在线| 久久久久久久久久久黄色| 色妹子一区二区| 国产成人免费高清| 久久99国产精品久久99果冻传媒| 一区二区三区中文字幕精品精品 | 中文字幕亚洲精品在线观看| 日韩欧美www| 欧美视频在线一区| 成人av第一页| 国产麻豆成人传媒免费观看| 日韩在线卡一卡二| 亚洲激情欧美激情| 成人欧美一区二区三区黑人麻豆| 精品第一国产综合精品aⅴ| 欧美色图12p| 色诱亚洲精品久久久久久| 成人黄色在线网站| 精品国产乱码久久久久久图片| 国产福利一区在线观看| 人人超碰91尤物精品国产| 亚洲自拍偷拍网站| 一二三区精品福利视频| 中文字幕在线观看一区| 国产精品护士白丝一区av| 日韩欧美的一区| 6080日韩午夜伦伦午夜伦| 欧美性色黄大片手机版| 色狠狠综合天天综合综合| 欧美一区二区高清| 成人一二三区视频| 久久电影国产免费久久电影| 日本欧美一区二区在线观看| 亚洲超碰97人人做人人爱| 一区二区三区美女| 亚洲老司机在线| 国产精品视频你懂的| 久久久久久影视| 亚洲国产电影在线观看| 久久亚洲春色中文字幕久久久| 7777精品伊人久久久大香线蕉的 | 亚洲女人小视频在线观看| 久久亚洲精品小早川怜子| 制服丝袜亚洲精品中文字幕| 欧美三级欧美一级| 欧美图区在线视频| 精品污污网站免费看| 成人18视频在线播放| 久久99精品一区二区三区三区| 性感美女久久精品| 亚洲国产精品麻豆| 亚洲国产人成综合网站| 亚洲午夜av在线| 丝袜a∨在线一区二区三区不卡| 亚洲午夜影视影院在线观看| 国产网站一区二区| 亚洲欧美日韩电影| 亚洲一区电影777| 亚洲午夜一二三区视频| 丝袜国产日韩另类美女| 亚洲成国产人片在线观看| 婷婷夜色潮精品综合在线| 久久国内精品自在自线400部| 国产一区二区三区在线看麻豆| 国产在线精品一区二区不卡了 | 香港成人在线视频| 秋霞电影网一区二区| 国产一区中文字幕| 国产91丝袜在线播放九色| 一本久道久久综合中文字幕| 91国偷自产一区二区开放时间| 欧美日韩亚州综合| 日韩欧美的一区| 国产精品欧美久久久久一区二区| 国产精品传媒视频| 亚洲线精品一区二区三区八戒| 国精产品一区一区三区mba视频| 国产成人啪免费观看软件 | 日韩一区在线播放| 亚洲一区二区视频在线| 免费成人在线影院| 成人av免费在线| 91精品国产一区二区人妖| 久久久综合网站| 一区二区三区在线视频观看 | 免费成人结看片| 成人免费的视频| 欧美日本高清视频在线观看| 欧美一级在线观看| 亚洲综合免费观看高清完整版 | 日韩欧美一级二级| 一区二区欧美国产| 国产精品自在在线| 精品视频在线免费| 国产精品污污网站在线观看| 日韩制服丝袜av| 99久久久精品| 久久日一线二线三线suv| 一区二区三区小说| 国内精品国产成人国产三级粉色 | 亚洲一区在线观看免费| 国产一区二区福利视频| 在线中文字幕一区| 久久影院电视剧免费观看| 亚洲福利视频一区二区| 国产99精品国产| 日韩视频一区在线观看| 亚洲国产精品一区二区尤物区| 粉嫩高潮美女一区二区三区| 91麻豆精品久久久久蜜臀| 国产精品久久久久久久久免费桃花 | 中文字幕在线免费不卡| 激情久久五月天| 欧美丰满少妇xxxxx高潮对白| 久久久综合九色合综国产精品| 老司机精品视频一区二区三区| 在线观看www91| 国产精品久久毛片av大全日韩| 紧缚奴在线一区二区三区| 欧美少妇性性性| 1000部国产精品成人观看| 国产一区二区视频在线| 欧美精品一区在线观看| 琪琪一区二区三区| 欧美日韩精品综合在线| 亚洲黄色在线视频| 99久久99久久精品国产片果冻| 久久久久久夜精品精品免费| 国产大陆精品国产| 久久亚洲一级片| 久久se这里有精品| 51精品视频一区二区三区| 偷窥少妇高潮呻吟av久久免费| 在线观看成人小视频| 亚洲一区在线免费观看| 欧美性受xxxx黑人xyx| 亚洲男帅同性gay1069| 国产成人超碰人人澡人人澡| 国产精品福利av| 波多野洁衣一区| 国产精品二区一区二区aⅴ污介绍| 成人精品视频一区二区三区尤物| 国产欧美一区二区精品性色超碰 | 国产精品18久久久| 国产亚洲欧美日韩在线一区| 国产激情视频一区二区在线观看 | 欧美一级艳片视频免费观看| 国产最新精品免费| 国产日产欧美一区二区视频| 成人avav影音| 亚洲乱码中文字幕|