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

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

?? bussearch.java~116~

?? 濟南公交管理系統 (不完善,沒有解決循環線路問題)
?? JAVA~116~
字號:
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();//換乘方案向量集

    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| 国产成人8x视频一区二区| 一区二区三区毛片| 亚洲国产经典视频| 一区二区三区在线免费观看| 成人18视频日本| 韩国av一区二区三区| 国产精品视频在线看| 欧美变态tickle挠乳网站| 在线观看视频欧美| 99精品久久久久久| 国产精品123| 裸体一区二区三区| 婷婷国产在线综合| 亚洲另类在线一区| 中文字幕精品一区| 久久九九国产精品| 精品国产1区二区| 欧美一二三区精品| 制服丝袜中文字幕一区| 日本系列欧美系列| 五月婷婷激情综合网| 亚洲欧美视频在线观看| 欧美激情在线观看视频免费| 精品国产凹凸成av人网站| av男人天堂一区| 国产综合色产在线精品| 国产成人精品一区二| 免费欧美日韩国产三级电影| 丝瓜av网站精品一区二区 | 91麻豆国产福利精品| 国产乱子轮精品视频| 韩国精品一区二区| 激情综合亚洲精品| 韩国在线一区二区| 国产一区二区三区精品欧美日韩一区二区三区 | 奇米777欧美一区二区| 亚洲午夜在线电影| 亚洲狠狠爱一区二区三区| 亚洲国产cao| 五月婷婷另类国产| 国产成人免费高清| 麻豆免费精品视频| 久久国产乱子精品免费女| 麻豆一区二区99久久久久| 久久国产剧场电影| 高潮精品一区videoshd| 成人影视亚洲图片在线| a级精品国产片在线观看| 成人深夜在线观看| 极品少妇一区二区三区精品视频| 另类人妖一区二区av| 国产真实乱子伦精品视频| 国产91精品露脸国语对白| 不卡的av中国片| 欧美综合色免费| 91精品一区二区三区在线观看| 国产一区二区三区精品欧美日韩一区二区三区| 国产美女娇喘av呻吟久久| 成人晚上爱看视频| 91久久久免费一区二区| 制服丝袜av成人在线看| 亚洲精品一区二区三区精华液| 欧美国产在线观看| 91麻豆国产福利在线观看| 久久99深爱久久99精品| 国产69精品久久久久777| 色噜噜狠狠色综合中国| 欧美一区二区免费| 国产精品久久久久三级| 午夜影院久久久| 国产精品夜夜爽| 日本高清成人免费播放| 日韩免费高清av| 国产精品动漫网站| 日韩极品在线观看| 成人免费视频国产在线观看| 欧美亚洲综合网| 精品国产一区二区三区四区四| 国产精品美女视频| 日韩电影在线免费| 亚洲人成7777| 久久国产精品99久久久久久老狼| 欧美日韩国产bt| 99久久精品国产导航| 欧美一区二区三区四区五区 | av欧美精品.com| 国产亚洲精久久久久久| 欧美日韩一区精品| 国产白丝网站精品污在线入口 | 国产在线视视频有精品| 91捆绑美女网站| 精品国产伦理网| 亚洲一线二线三线视频| 国产精品亚洲午夜一区二区三区| 色婷婷久久久综合中文字幕| 精品国产凹凸成av人网站| 亚洲第四色夜色| 成人免费视频网站在线观看| 欧美一级片在线| 欧美军同video69gay| 国产精品国产馆在线真实露脸| 麻豆精品新av中文字幕| 欧美午夜影院一区| 亚洲欧美综合另类在线卡通| 国内外成人在线| 欧美精品久久99| 亚洲精品高清在线观看| 欧美高清dvd| 欧美一区二区成人| 亚洲第一成年网| 91理论电影在线观看| 国产免费观看久久| 国精品**一区二区三区在线蜜桃| 91精品欧美久久久久久动漫| 亚洲永久免费视频| 91美女福利视频| 日韩美女精品在线| bt欧美亚洲午夜电影天堂| 国产日产欧美精品一区二区三区| 久久精品噜噜噜成人88aⅴ| 欧美刺激脚交jootjob| 日韩欧美国产系列| 喷白浆一区二区| 欧美一级欧美一级在线播放| 亚洲国产精品一区二区久久恐怖片| 亚洲精品国产第一综合99久久 | 91一区在线观看| 欧美激情在线看| 国产精品99久久久久久久vr| 精品国产乱码久久久久久浪潮| 国产大陆a不卡| 国产精品入口麻豆原神| 欧美一卡2卡3卡4卡| 亚洲国产另类精品专区| 在线观看免费一区| 国产成人精品影院| 欧美videos大乳护士334| 欧美三级电影网站| 裸体健美xxxx欧美裸体表演| 亚洲精品免费在线| 自拍偷拍国产精品| 精品国免费一区二区三区| 91亚洲精华国产精华精华液| 久久成人羞羞网站| 成人午夜在线播放| 欧美三级韩国三级日本一级| 久久成人免费网| 成人午夜av电影| 国产高清不卡二三区| 午夜精品久久久久| 一区二区日韩电影| 精品国产成人系列| 欧美国产一区在线| 中文字幕av不卡| 欧美国产亚洲另类动漫| 正在播放亚洲一区| 91香蕉视频mp4| 伦理电影国产精品| 99久久综合精品| 欧美天堂亚洲电影院在线播放| 国产一本一道久久香蕉| 北条麻妃一区二区三区| 欧美男人的天堂一二区| 久久久久久9999| 日韩国产精品91| 精品剧情在线观看| 亚洲美女精品一区| 99精品欧美一区二区三区小说| 91网址在线看| 国产精品素人视频| 亚洲一区二区3| 一区二区三区丝袜| 夜夜夜精品看看| 国产自产2019最新不卡| 99久久婷婷国产精品综合| 一本大道久久a久久精品综合| 日本精品免费观看高清观看| 91精品国产欧美一区二区成人| 欧美精品一区二区三区蜜臀| 国产精品成人免费精品自在线观看| 日本在线播放一区二区三区| 成人免费看的视频| 欧美卡1卡2卡| 亚洲视频在线观看三级| 亚洲人成人一区二区在线观看| 美国十次了思思久久精品导航| 顶级嫩模精品视频在线看| 91一区二区在线| 欧美一区二区啪啪| 亚洲情趣在线观看| 免费成人av在线播放| 99久久久免费精品国产一区二区| 欧美高清性hdvideosex| 精品剧情在线观看| 最新日韩在线视频|