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

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

?? bussearch.java~115~

?? 濟南公交管理系統 (不完善,沒有解決循環線路問題)
?? JAVA~115~
字號:
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++)
    {//換乘方案
      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()+"')";
      ResultSet rs3,rs4;
      try{
        rs3=conndb.stmt.executeQuery(sql3);//求出先乘車次號
        while(rs3.next())
        {
          line_start_vector.addElement(Integer.toString(rs3.getInt("車次號")));
        }
        //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+"')";
        rs4=conndb.stmt.executeQuery(sql4);
        while(rs4.next())
        {
          line_end_vector.addElement(Integer.toString(rs4.getInt("車次號")));
        }
        //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);
    }
    //說明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一区二区三区免费野_久草精品视频
亚洲成年人网站在线观看| 精品精品欲导航| 福利视频网站一区二区三区| 蜜乳av一区二区三区| 亚洲国产精品久久久男人的天堂| 亚洲黄色在线视频| 一区二区欧美视频| 午夜精品国产更新| 久久不见久久见免费视频7| 麻豆成人久久精品二区三区红| 欧美aaaaaa午夜精品| 久久99精品久久久久婷婷| 久久av中文字幕片| 成人性生交大片免费看中文| 99久久久国产精品| 欧美三级电影在线看| 国产亚洲一区二区三区四区 | 国产精品久久久久一区二区三区| 精品国产伦一区二区三区观看方式 | 欧美一区二区在线不卡| 欧美一区二区三区视频免费 | 欧美一级免费观看| 久久久美女艺术照精彩视频福利播放| 久久久久成人黄色影片| 亚洲伦理在线免费看| 日本欧美一区二区三区乱码| 国产99久久久精品| 欧美日韩美少妇| 久久九九影视网| 亚洲国产成人91porn| 精品一区二区三区久久久| 东方欧美亚洲色图在线| 欧美图片一区二区三区| 久久亚洲综合av| 亚洲一区二区av在线| 国产成人一区在线| 欧美老女人第四色| 国产精品盗摄一区二区三区| 日韩在线播放一区二区| 成人h精品动漫一区二区三区| 欧美日韩精品专区| 亚洲欧洲99久久| 久久精品国产色蜜蜜麻豆| 91丨九色丨尤物| 精品国产自在久精品国产| 亚洲综合一区二区精品导航| 国产精品自在欧美一区| 在线成人av网站| 椎名由奈av一区二区三区| 久久99这里只有精品| 欧美日韩久久久一区| 中文字幕在线观看不卡| 国内精品伊人久久久久影院对白| 欧美最猛黑人xxxxx猛交| 亚洲国产成人自拍| 国产呦萝稀缺另类资源| 日韩精品一区二区三区三区免费| 一区二区三区欧美视频| 成人综合日日夜夜| 久久美女高清视频 | 久久精品亚洲一区二区三区浴池| 性感美女极品91精品| 色综合久久久久久久久| 欧美国产97人人爽人人喊| 九九**精品视频免费播放| 欧美一区二区在线免费播放| 亚洲国产另类av| 欧美日韩一级片网站| 亚洲欧美日韩电影| 91日韩在线专区| 国产精品成人一区二区艾草| 丁香六月久久综合狠狠色| 欧美激情艳妇裸体舞| 国产不卡视频一区| 国产精品视频一二三区| 国产aⅴ精品一区二区三区色成熟| 国产亚洲一区字幕| 国产成人免费av在线| 欧美国产一区二区在线观看| 岛国一区二区三区| 中文字幕日韩精品一区| 91在线免费视频观看| 亚洲高清视频的网址| 欧美日韩高清不卡| 精品一区二区成人精品| 国产午夜精品一区二区三区四区| 国产91露脸合集magnet| 亚洲视频在线一区二区| 欧美午夜电影网| 捆绑调教一区二区三区| 久久久久国产一区二区三区四区| 成人爱爱电影网址| 亚洲综合一区二区精品导航| 欧美一级片在线| 国产成人综合自拍| 亚洲一区二区三区激情| 日韩欧美亚洲一区二区| 99久久精品国产观看| 午夜视频在线观看一区二区 | 国产偷国产偷精品高清尤物| www.日韩精品| 五月婷婷色综合| 久久久久99精品一区| 91免费观看视频| 久久国产精品区| 亚洲欧美日韩国产成人精品影院| 欧美一区二区在线免费播放| 国产精品1区2区| 午夜免费久久看| 久久午夜免费电影| 欧美日韩不卡在线| 国产91对白在线观看九色| 亚洲午夜在线观看视频在线| 精品粉嫩aⅴ一区二区三区四区| 成人免费视频视频| 日韩中文字幕av电影| 中文字幕在线观看不卡| 日韩精品一区二区三区swag| 色婷婷激情久久| 国产·精品毛片| 欧美aaaaa成人免费观看视频| 国产精品传媒视频| 欧美精品一区二区在线观看| 欧美日韩综合在线免费观看| www.在线欧美| 国内精品伊人久久久久影院对白| 亚洲国产精品久久久久秋霞影院 | 色综合天天性综合| 国精产品一区一区三区mba视频 | 国内精品伊人久久久久av影院| 亚洲免费成人av| 国产精品三级视频| 亚洲一区日韩精品中文字幕| 久久免费国产精品| 日韩欧美你懂的| 91精品国产色综合久久不卡电影| 91色porny蝌蚪| 成人黄色小视频| 成人黄页毛片网站| 国产成人亚洲综合色影视| 韩国成人精品a∨在线观看| 日本伊人午夜精品| 丝袜亚洲另类欧美| 偷窥少妇高潮呻吟av久久免费| 亚洲黄色在线视频| 亚洲一区在线视频| 亚洲超碰精品一区二区| 一区二区三区色| 亚洲五月六月丁香激情| 亚洲另类在线制服丝袜| 亚洲色图丝袜美腿| 一区二区三区精品视频在线| 国产精品无圣光一区二区| 国产欧美精品日韩区二区麻豆天美 | 波多野结衣中文字幕一区二区三区| 看片网站欧美日韩| 精品一区二区免费| 韩国成人福利片在线播放| 久久疯狂做爰流白浆xx| 韩日欧美一区二区三区| 加勒比av一区二区| 精品一区二区国语对白| 国产精选一区二区三区| 国产aⅴ综合色| 91在线porny国产在线看| 色激情天天射综合网| 欧美无人高清视频在线观看| 777欧美精品| 欧美α欧美αv大片| 欧美国产1区2区| 亚洲一区二区三区中文字幕 | 精品国一区二区三区| 久久精品人人爽人人爽| 17c精品麻豆一区二区免费| 亚洲男人的天堂av| 蜜臀久久99精品久久久画质超高清| 精品亚洲成a人在线观看| 国产激情91久久精品导航| 成人av网在线| 在线播放91灌醉迷j高跟美女| 欧美大度的电影原声| 中文字幕第一区第二区| 亚洲.国产.中文慕字在线| 久久国产精品第一页| 91蝌蚪porny| 日韩一区二区视频在线观看| 国产欧美日本一区视频| 午夜伊人狠狠久久| 粉嫩av一区二区三区在线播放| 在线观看视频一区二区| 2021久久国产精品不只是精品| 亚洲视频资源在线| 国产一区二区三区精品欧美日韩一区二区三区 | 成人免费电影视频| 88在线观看91蜜桃国自产| 国产精品素人视频| 久久国产精品区| 欧洲国内综合视频| 中文字幕乱码一区二区免费| 精一区二区三区|