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

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

?? indylist.java

?? 大量java源程序
?? JAVA
字號:
/* * @(#)IndyList.java * * Copyright (c) 1998 Karl Moss. All Rights Reserved. * * You may study, use, modify, and distribute this software for any * purpose provided that this copyright notice appears in all copies. * * This software is provided WITHOUT WARRANTY either expressed or * implied. * * @author  Karl Moss * @version 1.0 * @date    04Apr98 * */package javaservlets.db;import javax.servlet.*;import javax.servlet.http.*;import java.sql.*;/** * <p>This is a simple servlet that will use JDBC to gather all * of the Indy 500 winner  information from a database and format it * into an HTML table. This servlet uses HttpSessions to keep * track of the position within the ResultSet so that the * table can be split into several different pages, each with * a 'Next n rows' link. */public class IndyList extends HttpServlet{  /**    * <p>Performs the HTTP GET operation    *    * @param req The request from the client    * @param resp The response from the servlet    */  public void doGet(HttpServletRequest req,                    HttpServletResponse resp)    throws ServletException, java.io.IOException    {      // Get the last year shown on the page that      // called us. Remember that we are sorting      // the years in descending order.      String lastYear = req.getParameter("lastYear");      if (lastYear == null) {        lastYear = "9999";      }      // Get our URI      String uri = req.getRequestURI();      // Set the content type of the response      resp.setContentType("text/html");      // Create a PrintWriter to write the response      java.io.PrintWriter out =        new java.io.PrintWriter(resp.getOutputStream());      // Print the HTML header      out.println("<html>");      out.println("<head>");      out.println("<title>Indianapolis 500 Winners</title>");      out.println("</head>");      out.println("<h2><center>");      out.println("Indianapolis 500 Winners");      out.println("</center></h2>");      out.println("<br>");      // Create any addition properties necessary for connecting      // to the database, such as user and password      java.util.Properties props = new java.util.Properties();      props.put("user", "");      props.put("password", "");      query("sun.jdbc.odbc.JdbcOdbcDriver",            "jdbc:odbc:MyAccess",            props,            "SELECT * from IndyWinners where year < " +            lastYear + " order by year desc",            out,            uri);      // Wrap up      out.println("</html>");      out.flush();      out.close();    }  /**    * <p>Performs the HTTP POST operation    *    * @param req The request from the client    * @param resp The response from the servlet    */  public void doPost(HttpServletRequest req,                     HttpServletResponse resp)    throws ServletException, java.io.IOException    {      // Same as get      doGet(req, resp);    }  /**    * <p>Initialize the servlet. This is called once when the    * servlet is loaded. It is guaranteed to complete before any    * requests are made to the servlet    *    * @param cfg Servlet configuration information    */  public void init(ServletConfig cfg)    throws ServletException    {      super.init(cfg);    }  /**    * <p>Destroy the servlet. This is called once when the servlet    * is unloaded.    */  public void destroy()    {      super.destroy();    }  /**    * <p>Given the JDBC driver name, URL, and query string,    * execute the query and format the results into an    * HTML table    *    * @param driverName JDBC driver name    * @param connectionURL JDBC connection URL    * @param props Addition connection properties, such as user    * and password    * @param query SQL query to execute    * @param out PrintWriter to use to output the query results    * @param uri Request URI    * @return true if the query was successful    */  private boolean query(String driverName,                        String connectionURL,                        java.util.Properties props,                        String query,                        java.io.PrintWriter out,                        String uri)    {      boolean rc = true;      // The JDBC Connection object      Connection con = null;      // The JDBC Statement object      Statement stmt = null;      // The JDBC ResultSet object      ResultSet rs = null;      // Keep stats for how long it takes to execute      // the query      long startMS = System.currentTimeMillis();      // Keep the number of rows in the ResultSet      int rowCount = 0;      try {        // Create an instance of the JDBC driver so that it has        // a chance to register itself        Class.forName(driverName).newInstance();        // Create a new database connection.        con = DriverManager.getConnection(connectionURL, props);        // Create a statement object that we can execute queries        // with        stmt = con.createStatement();        // Execute the query        rs = stmt.executeQuery(query);        // Format the results into an HTML table        rowCount = formatTable(rs, out, uri);      }      catch (Exception ex) {        // Send the error back to the client        out.println("Exception!");        ex.printStackTrace(out);        rc = false;      }      finally {        try {          // Always close properly          if (rs != null) {            rs.close();          }          if (stmt != null) {            stmt.close();          }          if (con != null) {            con.close();          }        }        catch (Exception ex) {          // Ignore any errors here        }      }      // If we queried the table successfully, output some      // statistics      if (rc) {        long elapsed = System.currentTimeMillis() - startMS;        out.println("<br><i>" + rowCount + " rows in " +                    elapsed + "ms</i>");      }      return rc;    }  /**    * <p>Given a JDBC ResultSet, format the results into    * an HTML table    *    * @param rs JDBC ResultSet    * @param out PrintWriter to use to output the table    * @param uri Requesting URI    * @return The number of rows in the ResultSet    */  private int formatTable(java.sql.ResultSet rs,                          java.io.PrintWriter out,                          String uri)    throws Exception    {      int rowsPerPage = 10;      int rowCount = 0;      // Keep track of the last year found      String lastYear = "";      // This will be true if there is still more data in the      // table      boolean more = false;      // Create the table      out.println("<center><table border>");      // Process the results. First dump out the column      // headers as found in the ResultSetMetaData      ResultSetMetaData rsmd = rs.getMetaData();      int columnCount = rsmd.getColumnCount();      // Start the table row      out.println("<tr>");      for (int i = 0; i < columnCount; i++) {        // Create each table header. Note that the column index        // is 1-based        out.println("<th>" +                    rsmd.getColumnLabel(i + 1) +                    "</th>");      }      // End the table row      out.println("</tr>");      // Now walk through the entire ResultSet and get each      // row      while (rs.next()) {        rowCount++;        // Start a table row        out.println("<tr>");        // Dump out the values of each row        for (int i = 0; i < columnCount; i++) {          // Create the table data. Note that the column index          // is 1-based          String data = rs.getString(i + 1);          out.println("<td>" + data + "</td>");          // If this is the year column, cache it          if (i == 0) {            lastYear = data;          }        }        // End the table row        out.println("</tr>");        // If we are keeping track of the maximum number of        // rows per page and we have exceeded that count        // break out of the loop        if ((rowsPerPage > 0) &&            (rowCount >= rowsPerPage)) {          // Find out if there are any more rows after this one          more = rs.next();          break;        }      }      // End the table      out.println("</table></center>");      if (more) {        // Create a 'Next' button        out.println("<form method=POST action=\"" +                    uri + "\">");        out.println("<center>");        out.println("<input type=submit value=\"Next " +                    rowsPerPage + " rows\">");        out.println("</center>");        // Page was filled. Put in the last year that we saw        out.println("<input type=hidden name=lastYear value=" +                    lastYear + ">");        out.println("</form>");      }      return rowCount;    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
韩国v欧美v日本v亚洲v| 亚洲综合男人的天堂| 欧美日本在线视频| 欧美色综合网站| 欧美吻胸吃奶大尺度电影| 欧美影视一区在线| 在线视频欧美精品| 欧美精品三级日韩久久| 日韩一级大片在线观看| 欧美电影免费观看高清完整版 | 自拍偷拍欧美激情| 国产免费久久精品| 亚洲欧洲日韩综合一区二区| 国产精品久久久久久久久免费桃花 | 91精品一区二区三区在线观看| 欧美日本一区二区| 欧美电影免费提供在线观看| 久久综合五月天婷婷伊人| 国产三区在线成人av| 中文字幕亚洲区| 亚洲电影在线播放| 亚洲sss视频在线视频| 日韩精品国产精品| 紧缚奴在线一区二区三区| 国产精品77777竹菊影视小说| 国产精品99久久久久久有的能看| 91免费小视频| 91精品国产高清一区二区三区蜜臀| 欧美v亚洲v综合ⅴ国产v| 亚洲国产精品黑人久久久| 亚洲激情五月婷婷| 紧缚奴在线一区二区三区| 91亚洲国产成人精品一区二区三 | 精品一区二区三区视频| 粉嫩久久99精品久久久久久夜| 91视频精品在这里| 日韩免费在线观看| 亚洲精品日韩一| 国内一区二区视频| 欧美午夜精品理论片a级按摩| 久久久久久久久久久久电影 | 成人激情综合网站| 欧美日韩精品一区二区三区蜜桃| 久久精品视频免费观看| 亚洲国产成人av网| av网站一区二区三区| 日韩西西人体444www| 亚洲欧美韩国综合色| 国产激情视频一区二区三区欧美| 欧美色手机在线观看| 国产精品毛片a∨一区二区三区| 亚洲成人免费视频| www.亚洲激情.com| 久久精品这里都是精品| 免费观看一级特黄欧美大片| 欧洲精品在线观看| 国产精品久久久久aaaa樱花 | 91色在线porny| 久久综合九色综合97_久久久| 亚洲成人在线观看视频| jlzzjlzz欧美大全| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 成年人午夜久久久| 久久久久久电影| 精品一区二区三区在线播放| 欧美精品777| 亚洲一区免费观看| 欧洲精品一区二区| 亚洲激情第一区| 91精品91久久久中77777| 国产精品麻豆一区二区| 成人黄色免费短视频| 国产精品美女久久久久久| 福利91精品一区二区三区| 日本一区二区成人| 成人av电影在线| 中文字幕一区二区视频| 99久久精品一区| 国产精品久久久久久久久搜平片| 成人精品一区二区三区四区| 久久久久国产精品厨房| 国产成人一级电影| 综合中文字幕亚洲| 在线精品视频免费播放| 午夜精品久久久久久久99水蜜桃| 欧美美女一区二区| 免费高清不卡av| 国产亚洲精品aa午夜观看| 粉嫩av一区二区三区粉嫩| 国产精品九色蝌蚪自拍| 91啪亚洲精品| 天堂成人国产精品一区| 精品国产一区二区三区久久影院| 国产一区二区三区四区在线观看| 久久久777精品电影网影网| 成人精品电影在线观看| 亚洲自拍偷拍网站| 欧美一区二区精品在线| 国产乱码精品一区二区三区av | 日韩欧美国产一二三区| 狠狠色伊人亚洲综合成人| 欧美激情一区二区三区四区| 色天天综合色天天久久| 日日摸夜夜添夜夜添精品视频 | 人人爽香蕉精品| 久久久久久久av麻豆果冻| 91网站最新地址| 日本美女视频一区二区| 国产精品网站一区| 欧美乱熟臀69xxxxxx| 国产大片一区二区| 一区二区三区四区蜜桃| 26uuu国产一区二区三区| 91色在线porny| 国产制服丝袜一区| 亚洲在线视频一区| 久久精品综合网| 欧美精选在线播放| av在线不卡免费看| 九色|91porny| 天堂成人免费av电影一区| 中文字幕不卡的av| 日韩精品一区二区三区四区视频 | 国产福利视频一区二区三区| 一区二区三区四区在线免费观看| 精品国产乱码久久久久久久| 色系网站成人免费| 福利视频网站一区二区三区| 青青草成人在线观看| 亚洲免费av网站| 国产日韩亚洲欧美综合| 日韩一区二区三区观看| 欧美人伦禁忌dvd放荡欲情| 成人黄色小视频| 国产精品一区二区在线观看不卡| 亚洲国产精品天堂| 成人欧美一区二区三区视频网页| 精品国产一区久久| 在线不卡a资源高清| 91福利视频网站| 99re热视频精品| 成人免费视频免费观看| 国产一区二区中文字幕| 麻豆成人久久精品二区三区小说| 亚洲大型综合色站| 亚洲一区二区视频| 亚洲精品国产品国语在线app| 中文字幕制服丝袜成人av| 欧美精品一区二区三区一线天视频| 欧美视频一二三区| 欧美老女人在线| 欧美一区二区三区在| 69堂成人精品免费视频| 3d动漫精品啪啪| 制服丝袜亚洲播放| 欧美人体做爰大胆视频| 欧美高清精品3d| 欧美老人xxxx18| 欧美一个色资源| 久久久久国产一区二区三区四区| 久久影院午夜片一区| 亚洲国产精品黑人久久久| 亚洲国产成人在线| 亚洲男人都懂的| 天天色 色综合| 久色婷婷小香蕉久久| 黑人精品欧美一区二区蜜桃| 国产成人鲁色资源国产91色综| 成人不卡免费av| 欧美丝袜丝交足nylons| 欧美日韩国产免费一区二区 | 欧美国产日韩亚洲一区| 中文字幕在线观看一区二区| 成人免费在线观看入口| 亚洲免费成人av| 麻豆精品视频在线观看视频| 懂色一区二区三区免费观看 | 免费看日韩a级影片| 国产精品一色哟哟哟| 99久久精品国产毛片| 欧美精品18+| 欧美高清一级片在线观看| 亚洲综合色噜噜狠狠| 蜜桃精品视频在线| 成人黄色777网| 6080日韩午夜伦伦午夜伦| 国产日韩成人精品| 亚洲一区二区黄色| 国产九色精品成人porny| 欧美性猛片aaaaaaa做受| 久久综合久久99| 亚洲一区在线观看网站| 国产伦精品一区二区三区视频青涩 | 成人aaaa免费全部观看| 8x8x8国产精品| 亚洲日本在线观看| 精品在线播放免费| 在线视频一区二区三区| 国产欧美日本一区视频| 蜜桃免费网站一区二区三区|