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

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

?? fastemployeelist1.java

?? 大量java源程序
?? JAVA
字號:
/* * @(#)FastEmployeeList1.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 employee information from a database and format it * into an HTML table. This servlet uses a local connection * pool. */public class FastEmployeeList1 extends HttpServlet{  // Our connection pool. Note that instance variables are  // actually global to all clients since there is only  // one instance of the servlet that has multiple threads  // of execution  javaservlets.jdbc.ConnectionPool m_connectionPool;  /**    * <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    {      // 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>Employee List</title>");      out.println("</head>");      out.println("<h2><center>");      out.println("Employees for Nezzer's Chocolate Factory");      out.println("</center></h2>");      out.println("<br>");      out.println("<center>");      out.println("(with local connection pool)");      out.println("</center><br>");      query("SELECT Empno, Name, Position FROM Employee",            out);      // Wrap up      out.println("</html>");      out.flush();      out.close();    }  /**    * <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);      // Create our connection pool      m_connectionPool = new javaservlets.jdbc.ConnectionPool();      // Initialize the connection pool. This will start all      // of the connections as specified in the connection      // pool configuration file      try {        m_connectionPool.initialize();      }      catch (Exception ex) {        // Convert the exception        ex.printStackTrace();        throw new ServletException          ("Unable to initialize connection pool");      }    }  /**    * <p>Destroy the servlet. This is called once when the servlet    * is unloaded.    */  public void destroy()    {      // Tear down our connection pool if it was created      if (m_connectionPool != null) {        m_connectionPool.destroy();      }      super.destroy();    }  /**    * <p>Given the SQL query string, execute the query and    * format the results into an HTML table    *    * @param query SQL query to execute    * @param out PrintWriter to use to output the query results    * @return true if the query was successful    */  private boolean query(String query,                        java.io.PrintWriter out)    {      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 {        // Get an available connection from our connection pool        con = m_connectionPool.getConnection();        // 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);      }      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) {            // Put the connection back into the pool            m_connectionPool.close(con);          }        }        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    * @return The number of rows in the ResultSet    */  private int formatTable(java.sql.ResultSet rs,                          java.io.PrintWriter out)    throws Exception    {      int rowCount = 0;      // 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          out.println("<td>" +                      rs.getString(i + 1) +                      "</td>");        }        // End the table row        out.println("</tr>");      }      // End the table      out.println("</table></center>");      return rowCount;    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美色图一区二区三区| www.爱久久.com| av资源网一区| 91精品国产综合久久精品性色| 337p亚洲精品色噜噜狠狠| 欧美激情在线一区二区| 日韩国产欧美视频| 91视频在线看| 久久婷婷色综合| 天天综合色天天综合色h| 国产一区二区按摩在线观看| 欧美专区亚洲专区| 中文字幕一区二区在线观看| 精品一区二区免费视频| 91福利资源站| 17c精品麻豆一区二区免费| 久久精品国产99国产精品| 欧美日韩国产一级二级| 亚洲视频资源在线| 国产成人精品三级| 2014亚洲片线观看视频免费| 日韩电影在线看| 在线观看日韩高清av| 中文一区在线播放| 国产精品系列在线播放| 久久久久久**毛片大全| 黄色精品一二区| 日韩欧美国产麻豆| 蜜桃视频免费观看一区| 91精品中文字幕一区二区三区| 亚洲裸体xxx| 91丨九色porny丨蝌蚪| 国产精品国产三级国产aⅴ中文 | av在线不卡电影| 国产午夜精品久久久久久免费视| 精品一区二区三区视频在线观看| 91精品在线免费观看| 日韩**一区毛片| 91精品国产aⅴ一区二区| 午夜精品福利一区二区三区av| 久久精品国产99| 日本系列欧美系列| 91精品欧美久久久久久动漫| 美女视频网站黄色亚洲| 精品久久久影院| 国产福利一区在线观看| 综合色中文字幕| 欧美午夜精品一区二区蜜桃| 日韩高清国产一区在线| 日韩精品一区二区在线观看| 国产黄人亚洲片| 国产精品久久久久影视| 在线中文字幕一区| 日韩一区精品字幕| 欧美精品一区二区三区视频| 国产乱子伦一区二区三区国色天香| 久久久久久久久伊人| 成人毛片在线观看| 亚洲国产一区视频| 精品人伦一区二区色婷婷| 国v精品久久久网| 亚洲视频在线一区| 88在线观看91蜜桃国自产| 久久99国产精品久久99果冻传媒| 国产日韩欧美电影| 欧美亚洲动漫精品| 经典三级在线一区| 一区二区三区日韩欧美精品| 日韩视频在线你懂得| 成人亚洲一区二区一| 亚洲小说欧美激情另类| 久久综合丝袜日本网| 成人免费高清在线| 视频一区视频二区中文| 日本一区二区不卡视频| 欧美日韩中文一区| 高清不卡一区二区| 视频一区二区三区中文字幕| 国产无遮挡一区二区三区毛片日本| 色丁香久综合在线久综合在线观看| 免费观看成人鲁鲁鲁鲁鲁视频| 国产精品免费免费| 日韩欧美在线观看一区二区三区| av高清久久久| 国内精品国产三级国产a久久| 亚洲免费av在线| 久久久久久久久久久久久久久99 | 日韩精品一二三四| 中文字幕一区二区5566日韩| 欧美高清dvd| 一本到一区二区三区| 国产成人亚洲综合a∨婷婷图片| 亚洲国产成人高清精品| 国产精品久久久久影视| 日韩欧美亚洲国产精品字幕久久久| 成人黄色片在线观看| 久久99国产精品成人| 亚洲自拍偷拍综合| 中文字幕欧美日韩一区| 日韩久久久久久| 欧美挠脚心视频网站| 色偷偷一区二区三区| 成人综合激情网| 国产成人精品三级| 国产成人h网站| 国产在线观看一区二区| 久久疯狂做爰流白浆xx| 天堂蜜桃一区二区三区| 亚洲一区二区三区四区在线免费观看| 国产精品视频麻豆| 国产色一区二区| 久久一区二区三区四区| 欧美日韩久久不卡| 欧美日韩中文另类| 欧美午夜视频网站| 欧洲日韩一区二区三区| 欧美艳星brazzers| 欧美视频中文字幕| 欧美色综合久久| 欧美日本在线一区| 在线成人午夜影院| 欧美一区二区三区人| 日韩一区二区三区四区 | 久久久久久日产精品| 久久久高清一区二区三区| 国产日韩欧美a| 亚洲欧美综合色| 亚洲一二三区视频在线观看| 亚洲一区成人在线| 午夜欧美大尺度福利影院在线看 | 精品少妇一区二区三区在线播放 | 亚洲线精品一区二区三区八戒| 亚洲女同女同女同女同女同69| 亚洲免费色视频| 天堂va蜜桃一区二区三区漫画版| 免费在线欧美视频| 大尺度一区二区| 色视频成人在线观看免| 欧美日韩第一区日日骚| 精品国产麻豆免费人成网站| 欧美激情综合在线| 亚洲电影一级片| 精品一区二区三区不卡| 93久久精品日日躁夜夜躁欧美| 91电影在线观看| 制服.丝袜.亚洲.另类.中文| 久久婷婷久久一区二区三区| 亚洲国产成人私人影院tom| 中文字幕中文在线不卡住| 自拍偷拍亚洲激情| 午夜久久久久久久久久一区二区| 日韩制服丝袜av| 成人av网站免费观看| 欧美日韩小视频| 久久精品一区八戒影视| 中文字幕字幕中文在线中不卡视频| 亚洲成va人在线观看| 国产传媒一区在线| 91精品麻豆日日躁夜夜躁| 久久久噜噜噜久久中文字幕色伊伊| 亚洲女人****多毛耸耸8| 卡一卡二国产精品| 91美女精品福利| 久久美女高清视频| 午夜国产不卡在线观看视频| 国产成a人亚洲| 日韩一本二本av| 亚洲精品免费一二三区| 久久草av在线| 欧美电影一区二区| 综合电影一区二区三区 | 美国十次综合导航| 91免费看视频| 国产欧美一区二区精品性| 日本aⅴ亚洲精品中文乱码| 97se亚洲国产综合自在线观| www国产精品av| 蜜桃视频一区二区三区 | 国产欧美一区二区精品婷婷| 日日骚欧美日韩| 99久久免费国产| 中文字幕 久热精品 视频在线| 国内成人免费视频| 日韩一区二区高清| 五月天欧美精品| 欧美日韩夫妻久久| 亚洲成人一区二区| 色婷婷久久久久swag精品| 亚洲欧洲av在线| 成人性生交大片| 国产精品久久久久久久岛一牛影视| 久久99久久99| 日韩精品一区在线观看| 日本aⅴ亚洲精品中文乱码| 欧美精品亚洲一区二区在线播放| 夜夜嗨av一区二区三区四季av | 日韩精品最新网址| 日本亚洲三级在线| 日韩视频永久免费| 久久se这里有精品|