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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? bussearch.java~114~

?? 濟南公交管理系統 (不完善,沒有解決循環線路問題)
?? JAVA~114~
字號:
import java.sql.*;
import java.util.*;
public class busSearch
{
  //private String station_Name;//公交站點名
  //private int line_Number;//公交車次號
  String databasename="jnbus";//數據源名
  connectDB conndb=new connectDB();//聲明連接數據庫類的一個對象
  public busSearch(){
  }
  /////////////////////////////////////////////////////////////////////////////
  public int countStation(String startStation,String endStation,int line_number)
  {
    //功能:在某一個車次,查詢開始站和終點站之間的站點數(可直達的站點)
    //返回值:整形,站點數
    conndb.connectDb(databasename);
    int countStation=0;//記錄站點數
    int startnum=1,endnum=1;//開始站點序號,終止站點序號,并初始化為1
    String sql1="select 序號 from stationinfo where 車次號="+line_number+" and 站點名="+"'"+startStation+"'"+"";
    String sql2="select 序號 from stationinfo where 車次號="+line_number+" and 站點名="+"'"+endStation+"'"+"";
    ResultSet rs1,rs2;
    try{
      rs1=conndb.stmt.executeQuery(sql1);
      while(rs1.next()){
        startnum=rs1.getInt("序號");//開始站點序號
      }
      rs1.close();
      rs2=conndb.stmt.executeQuery(sql2);
      while(rs2.next()){
        endnum=rs2.getInt("序號");//終止站點序號
      }
      rs2.close();
    }catch(SQLException e){
      System.out.println(e);//打印sql執行錯誤信息
    }
    countStation=compare(startnum,endnum);//求出兩個站點間的站點數
    return countStation;//返回站點數
  }
  /////////////////////////////////////////////////////////////////////////////
  public int compare(int a,int b)
  {
    //功能:計算兩個整數之差
    //返回值:整形,兩數之差
    int c=0;
    if(a>=b){
      c=a-b;
    }
    else
      c=b-a;
    return c;
  }
  /////////////////////////////////////////////////////////////////////////////
  public Vector search_Station(String station_name)
  {
    //功能:輸入站點名稱,輸出經過該站點的車次,精確查詢
    //返回值:車次號向量
    conndb.connectDb(databasename);
    int line_number;
    Vector linenum_vector=new Vector();//車次號向量
    linenum_vector.removeAllElements();
    String sql="select 車次號 from stationinfo where 站點名="+"'"+station_name+"'"+"";
    ResultSet rs;
    try{
      rs=conndb.stmt.executeQuery(sql);
      while(rs.next())
      {
        line_number=rs.getInt("車次號");//取出結果集中的車次號
        linenum_vector.addElement(Integer.toString(line_number));//將車次號加入向量linenumVector
      }
      rs.close();//關閉結果集
    }
    catch(SQLException e){
      System.out.println(e);
    }
    return linenum_vector;//返回車次號向量
  }
  /////////////////////////////////////////////////////////////////////////////
  public Vector search_closeStation(String station_name)
  {
    //功能:輸入模糊站點名稱,輸出相近的站點名稱
    //返回值:站點名稱向量
    conndb.connectDb(databasename);
    String station_Name;
    Vector stationname_vector=new Vector();//站點名向量
    stationname_vector.removeAllElements();
    String sql="select distinct 站點名 from stationinfo where 站點名 like '%"+station_name+"%'";
    ResultSet rs;
    try{
      rs=conndb.stmt.executeQuery(sql);
      while(rs.next())
      {
        station_Name=rs.getString("站點名");
        stationname_vector.addElement(station_Name);
      }
      rs.close();
    }
    catch(SQLException e){
      System.out.println(e);
    }
    return stationname_vector;
  }
  /////////////////////////////////////////////////////////////////////////////
  public Vector search_LineProperty(int line_number)
  {
    //功能:輸入車次號,輸出該車次始發站,終點站,上行時間,下行時間,是否空調等屬性
    //返回值:所有屬性內容的向量
    conndb.connectDb(databasename);
    String startstation,starttime,endstation,endtime,shifoukongtiao;//線路屬性
    Vector lineproperty_vector=new Vector();//線路屬性向量
    Vector line_vector=new Vector();//所有線路屬性集合向量
    lineproperty_vector.removeAllElements();//向量清空
    line_vector.removeAllElements();//向量清空
    String sql="select 始發站,營運時間上,終點站,營運時間下,是否空調 from businfo where 車次號="+line_number+"";
    ResultSet rs;
    try{
      rs=conndb.stmt.executeQuery(sql);//執行線路屬性搜索
      while(rs.next())
      {
        startstation=rs.getString("始發站");
        starttime=rs.getString("營運時間上");
        endstation=rs.getString("終點站");
        endtime=rs.getString("營運時間下");
        shifoukongtiao=rs.getString("是否空調");
        lineproperty_vector.addElement(startstation);
        lineproperty_vector.addElement(starttime);
        lineproperty_vector.addElement(endstation);
        lineproperty_vector.addElement(endtime);
        lineproperty_vector.addElement(shifoukongtiao);
        line_vector.add(lineproperty_vector);//將線路屬性加入向量vector
      }
      rs.close();
    }catch(SQLException e)
    {
      System.out.println(e);
    }
    return line_vector;
  }
  /////////////////////////////////////////////////////////////////////////////
  public Vector search_Linestation(int line_number)
  {
    //功能:輸入車次號,輸出該車次經過的站點
    //返回值:車次站點向量
    conndb.connectDb(databasename);
    String station_name;//站點名
    int station_number;//站點序號
    Vector line_vector=new Vector();//該車次站點向量
    line_vector.removeAllElements();
    String sql="select 序號,站點名 from stationinfo where 車次號="+line_number;
    ResultSet rs;
    try{
      rs=conndb.stmt.executeQuery(sql);
      while(rs.next())
      {
        Vector station_vector=new Vector();//站點向量
        station_number=rs.getInt("序號");
        station_name=rs.getString("站點名");
        station_vector.addElement(Integer.toString(station_number));//序號加入站點向量
        station_vector.addElement(station_name);//站點名加入站點向量
        line_vector.add(station_vector);//站點向量加入車次站點向量
      }
      rs.close();
    }catch(SQLException e){
      System.out.println(e);
    }
    return line_vector;
  }
  /////////////////////////////////////////////////////////////////////////////
  public Vector search_nonstop(String start_station,String end_station)
  {
    //功能 :輸入起始站和終點站,查詢可直達的車次
    //返回值:可直達車次向量
    conndb.connectDb(databasename);
    Vector nonstop_vector=new Vector();//可直達車次向量
    nonstop_vector.removeAllElements();
    int line_number;
    String sql="select 車次號,序號 from stationinfo  where  站點名= '"+start_station+"' and 車次號 in(select 車次號 from stationinfo where 站點名='"+end_station+"')";
    ResultSet rs;
   //站點均存在,進行查詢。
      try{
        rs = conndb.stmt.executeQuery(sql);
        while (rs.next())
        {
          line_number = rs.getInt("車次號");
          nonstop_vector.addElement(Integer.toString(line_number));
        }
        rs.close();
      }catch(SQLException e){
        System.out.println(e);
      }
    return nonstop_vector;
  }
  /////////////////////////////////////////////////////////////////////////////
  public Vector vector_intersection(Vector a,Vector b)
  {
    //功能:求兩個向量的交集
    //返回值:交集向量
    conndb.connectDb(databasename);
    Vector intersection=new Vector();//交集向量
    int a_length,b_length;
    a_length=a.size();//向量a的長度
    b_length=b.size();//向量b的長度
    for(int i=0;i<a_length;i++)
    {
      String a_element=a.get(i).toString();
      for(int j=0;j<b_length;j++)
      {
        String b_element=b.get(j).toString();
        if(a_element.equalsIgnoreCase(b_element))
        {
          intersection.add(b_element);
          break;
        }
      }
    }
    return intersection;//返回交集
  }
  /////////////////////////////////////////////////////////////////////////////
  public Vector search_oncechange(String start_station,String end_station)
  {
    //功能: 輸入起始站和終止站,查詢一次換乘方案,換乘站點,乘車車次
    //返回值:一次乘車向量,先乘車次,換乘站點,換乘車次
    conndb.connectDb(databasename);
    String start_station_name,end_station_name;
    Vector start_station_vector=new Vector();//經過站點start_station的車次所經過的站點向量
    Vector end_station_vector=new Vector();//經過站點end_station的車次所經過的站點向量
    Vector change_station_vector=new Vector();//換乘站點向量
    Vector change_start_vector=new Vector();//先乘車次向量集
    Vector change_end_vector=new Vector();//換乘車次向量集


    Vector change_solution_vector=new Vector();//換乘方案向量集
    start_station_vector.removeAllElements();
    end_station_vector.removeAllElements();
    change_station_vector.removeAllElements();
    change_start_vector.removeAllElements();
    change_end_vector.removeAllElements();


    change_solution_vector.removeAllElements();
    int start_station_length,end_station_length,change_station_length;
    String sql1="select distinct 站點名 from stationinfo where 車次號 in(select distinct 車次號 from stationinfo where 站點名="+"'"+start_station+"'"+")";
    String sql2="select distinct 站點名 from stationinfo where 車次號 in(select distinct 車次號 from stationinfo where 站點名="+"'"+end_station+"'"+")";
    ResultSet rs1,rs2;
    try{
      rs1=conndb.stmt.executeQuery(sql1);
      while(rs1.next())
      {
        start_station_name=rs1.getString("站點名");
        start_station_vector.addElement(start_station_name);//將站點加入start_station_vector向量
      }
      start_station_length=start_station_vector.size();//向量start_station_vector的長度
      rs1.close();//關閉結果集
      rs2=conndb.stmt.executeQuery(sql2);
      while(rs2.next())
      {
        end_station_name=rs2.getString("站點名");
        end_station_vector.addElement(end_station_name);//將站點加入end_station_vector向量
      }
      end_station_length=end_station_vector.size();//向量end_station_vector的長度
      rs2.close();//關閉結果集
    }catch(SQLException e){
      System.out.println(e);
    }
    change_station_vector=vector_intersection(start_station_vector,end_station_vector);//交集向量,換乘站點向量
    change_station_length=change_station_vector.size();
    for(int i=0;i<change_station_length;i++)
    {//換乘方案
      System.out.println("中轉站:"+change_station_vector.elementAt(i)+" ");
      Vector line_start_vector=new Vector();//先乘車次向量
      Vector line_end_vector=new Vector();//換乘車次向量
      Vector change_vector=new Vector();//換乘方案向量
      //change_vector.removeAllElements();//先清空換乘方案向量
      String sql3="select  distinct 車次號 from stationinfo  where  站點名= '"+start_station+"' and 車次號 in(select distinct 車次號 from stationinfo where 站點名='"+change_station_vector.get(i).toString().trim()+"')";

      System.out.println(sql3);
      ResultSet rs3,rs4;
      try{
        rs3=conndb.stmt.executeQuery(sql3);//求出先乘車次號
        int x=0;int y=0;
        System.out.print("先乘  ");
        while(rs3.next())
        {
          line_start_vector.addElement(Integer.toString(rs3.getInt("車次號")));
          System.out.print(line_start_vector.elementAt(x)+"  ");
          x++;
        }
        //change_start_vector.add(line_start_vector);//先乘車次向量
        rs3.close();
        String sql4="select  distinct 車次號 from stationinfo  where  站點名= '"+change_station_vector.get(i).toString().trim()+"' and 車次號 in(select distinct 車次號 from stationinfo where 站點名='"+end_station+"')";
        System.out.println(sql4);
        rs4=conndb.stmt.executeQuery(sql4);
        System.out.print("換乘   ");
        while(rs4.next())
        {
          line_end_vector.addElement(Integer.toString(rs4.getInt("車次號")));
          System.out.print(line_end_vector.elementAt(y)+"  ");
          y++;
        }
        //change_end_vector.add(line_end_vector);//換乘車次向量
        rs4.close();
      }
      catch(SQLException e){
        System.out.println(e);
      }
      change_vector.add(line_start_vector);
      change_vector.add(change_station_vector.get(i).toString());
      change_vector.add(line_end_vector);
      change_solution_vector.add(change_vector);
      System.out.println();
    }
    //說明1:先乘車次向量change_start_vector內容是向量。
    //說明2:換乘車次向量change_end_vector內容是向量。
    //說明3:先乘車次向量和換乘車次向量和換乘站點向量長度是一樣的。
    //說明4:換乘方案向量change_vector內容是:先乘車次向量,換乘站點,換乘車次向量
    //說明5:換乘方案向量集change_solution_vector內容是換乘方案向量
    return change_solution_vector;
  }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国v精品久久久网| 国产精品热久久久久夜色精品三区 | 国产成人在线色| 欧美午夜电影网| 亚洲你懂的在线视频| 99久久国产综合精品女不卡| 日本一区二区三区电影| 国产精品小仙女| 日本一区二区三区免费乱视频| 国产麻豆欧美日韩一区| 亚洲精品在线三区| 狠狠色综合日日| 亚洲精品在线电影| 国产一二三精品| 精品国产免费视频| 国产精品小仙女| 中文字幕免费观看一区| 成人免费观看男女羞羞视频| 国产精品亲子乱子伦xxxx裸| 99精品视频一区二区三区| 国产精品护士白丝一区av| 91亚洲国产成人精品一区二三| 亚洲三级小视频| 欧美色图12p| 国产精品亚洲成人| 亚洲精品中文字幕在线观看| 日韩欧美成人一区二区| 国产成人在线色| 久久精品网站免费观看| 国产精品中文字幕日韩精品| 日韩理论片中文av| 欧美日韩亚洲综合在线| 久久国产精品72免费观看| 日韩精品一区二区三区视频播放 | 国产嫩草影院久久久久| 91日韩一区二区三区| 亚洲一区二区三区四区五区黄| 欧美三级三级三级| 韩国女主播一区| 国产精品理伦片| 欧美日韩在线观看一区二区| 免费在线一区观看| 国产亚洲一区二区三区在线观看 | 91在线免费播放| 一区二区三区四区不卡在线| 日韩一区二区中文字幕| av亚洲精华国产精华| 亚洲3atv精品一区二区三区| 久久久蜜臀国产一区二区| av电影在线观看完整版一区二区| 亚洲一本大道在线| 久久久蜜桃精品| 欧美精品v国产精品v日韩精品| 国产一区二区看久久| 亚洲欧美日韩国产另类专区| 欧美精品黑人性xxxx| 成人动漫在线一区| 另类中文字幕网| 亚洲综合色丁香婷婷六月图片| 欧美电影免费观看高清完整版在线 | 国产精品每日更新在线播放网址 | 欧美精品乱码久久久久久 | caoporen国产精品视频| 日韩电影在线免费| 亚洲欧美欧美一区二区三区| 精品国产乱码久久久久久闺蜜| 色婷婷综合在线| 福利91精品一区二区三区| 天天影视涩香欲综合网| 亚洲激情第一区| 国产清纯美女被跳蛋高潮一区二区久久w| 91福利资源站| 成人三级在线视频| 精品在线你懂的| 日韩电影一区二区三区四区| 一区二区在线观看视频| 国产日产欧美一区| 精品久久久久香蕉网| 欧美亚洲尤物久久| 91色在线porny| 不卡在线视频中文字幕| 国产精品综合一区二区三区| 日本不卡免费在线视频| 一区二区三区美女| 亚洲人成网站色在线观看| 国产欧美日韩三级| 精品国产一区二区亚洲人成毛片| 欧美久久久久中文字幕| 国产成人av网站| 国内欧美视频一区二区 | 爽好久久久欧美精品| 亚洲综合色噜噜狠狠| 亚洲免费伊人电影| ㊣最新国产の精品bt伙计久久| 国产午夜久久久久| 久久久国产精品不卡| 精品99一区二区三区| 精品国精品国产尤物美女| 精品久久久久99| 久久午夜羞羞影院免费观看| 精品国产一区a| 久久网这里都是精品| 久久亚洲综合色一区二区三区| 精品国产乱码久久久久久影片| 欧美mv和日韩mv国产网站| 精品嫩草影院久久| 精品国产第一区二区三区观看体验 | 日韩激情一二三区| 日本欧美一区二区三区乱码| 久久av中文字幕片| 国精产品一区一区三区mba视频 | 色吧成人激情小说| 欧美色综合天天久久综合精品| 欧美在线观看视频一区二区三区 | 国产日韩欧美激情| 亚洲欧洲av在线| 亚洲一区二区三区四区五区中文 | 国产精品女上位| 亚洲高清在线精品| 久久尤物电影视频在线观看| 精品国产免费人成电影在线观看四季| 日韩精品一区二区三区swag | 成人在线视频一区| 国产一区二区免费在线| 成人免费看黄yyy456| 91视频免费观看| 欧美精品三级在线观看| 日韩精品中午字幕| 国产精品丝袜一区| 亚洲成人激情av| 九色|91porny| 99久久精品久久久久久清纯| 欧美色手机在线观看| 精品国产一区二区国模嫣然| 亚洲色欲色欲www| 日韩成人dvd| www.在线欧美| 欧美另类高清zo欧美| 国产欧美精品一区aⅴ影院| 亚洲综合一区在线| 国产一区二区在线电影| 粉嫩绯色av一区二区在线观看| 色偷偷88欧美精品久久久| 欧美日韩国产美| 国产精品超碰97尤物18| 天天影视涩香欲综合网| 成人av免费在线播放| 欧美精品vⅰdeose4hd| 国产精品狼人久久影院观看方式| 日韩av在线发布| 91欧美激情一区二区三区成人| 欧美一区二区三区播放老司机| 国产精品国产三级国产三级人妇 | 久久视频一区二区| 亚洲国产日韩a在线播放性色| 国产一区二区毛片| 91精品国产一区二区| 中文字幕中文乱码欧美一区二区| 天天综合网 天天综合色| 99精品久久只有精品| 日韩三级在线观看| 夜夜嗨av一区二区三区| 国产传媒日韩欧美成人| 日韩精品中午字幕| 亚洲小说春色综合另类电影| 99综合电影在线视频| 日韩欧美在线1卡| 亚洲成在人线免费| 在线亚洲精品福利网址导航| 国产女同互慰高潮91漫画| 老汉av免费一区二区三区| 欧美日韩视频在线一区二区| 亚洲欧洲成人av每日更新| 国产精品一级黄| 久久婷婷国产综合精品青草| 另类中文字幕网| 日韩一区二区免费高清| 图片区小说区区亚洲影院| 欧美三电影在线| 亚洲在线观看免费| 91蝌蚪国产九色| 中文字幕在线观看一区| 国产真实乱对白精彩久久| 日韩午夜激情av| 亚洲午夜一区二区| 成人污视频在线观看| 久久蜜桃av一区二区天堂| 久久精品二区亚洲w码| 91超碰这里只有精品国产| 天天影视色香欲综合网老头| 欧美乱熟臀69xxxxxx| 日韩高清不卡一区二区三区| 91麻豆精品国产自产在线| 亚洲成在线观看| 欧美福利视频一区| 美女国产一区二区三区| 精品人在线二区三区| 国内精品嫩模私拍在线| 久久久久久久久久久电影| 国产又黄又大久久|