⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test_0002ejsp_jsp.java

📁 学习Java 非常好的电子 讲义。欢迎大家下载。学习。
💻 JAVA
字号:
import java.sql.*;
import javabean.Connect;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;


public class test_0002ejsp_jsp extends HttpJspBase {


    static {
    }
    public test_0002ejsp_jsp( ) {
    }

    private static boolean _jspx_inited = false;

    public final void _jspx_init() throws org.apache.jasper.runtime.JspException {
    }

    public void _jspService(HttpServletRequest request, HttpServletResponse  response)
        throws java.io.IOException, ServletException {

        JspFactory _jspxFactory = null;
        PageContext pageContext = null;
        HttpSession session = null;
        ServletContext application = null;
        ServletConfig config = null;
        JspWriter out = null;
        Object page = this;
        String  _value = null;
        try {

            if (_jspx_inited == false) {
                synchronized (this) {
                    if (_jspx_inited == false) {
                        _jspx_init();
                        _jspx_inited = true;
                    }
                }
            }
            _jspxFactory = JspFactory.getDefaultFactory();
            response.setContentType("text/html; charset=GBK");
            pageContext = _jspxFactory.getPageContext(this, request, response,
            			"", true, 8192, true);

            application = pageContext.getServletContext();
            config = pageContext.getServletConfig();
            session = pageContext.getSession();
            out = pageContext.getOut();

            // HTML // begin [file="/test.jsp";from=(0,48);to=(1,0)]
                out.write("\r\n");

            // end
            // HTML // begin [file="/test.jsp";from=(1,31);to=(2,0)]
                out.write("\r\n");

            // end
            // HTML // begin [file="/test.jsp";from=(2,36);to=(7,1)]
                out.write("\r\n\r\n<html>\r\n<body bgcolor=\"#fff000\"><center>\r\n\r\n ");

            // end
            // begin [file="/test.jsp";from=(7,3);to=(13,2)]
                
                    Connect con=new Connect();
                    ResultSet rs = con.executeQuery("select * from student");
                    ResultSetMetaData rsmd = rs.getMetaData();
                    int colnum = rsmd.getColumnCount();
                    boolean  more = rs.next();
                  
            // end
            // HTML // begin [file="/test.jsp";from=(13,4);to=(16,3)]
                out.write("\r\n<table border=2 >\r\n<tr>\r\n   ");

            // end
            // begin [file="/test.jsp";from=(16,5);to=(16,37)]
                 for(int i=1; i<= colnum; i++){ 
            // end
            // HTML // begin [file="/test.jsp";from=(16,39);to=(17,11)]
                out.write("\r\n     <td>  ");

            // end
            // begin [file="/test.jsp";from=(17,13);to=(17,47)]
                out.print(rsmd.getColumnName(i));}
            // end
            // HTML // begin [file="/test.jsp";from=(17,49);to=(22,0)]
                out.write(" </tr>\r\n\r\n <p>\r\n\r\n\r\n");

            // end
            // begin [file="/test.jsp";from=(22,2);to=(22,21)]
                    while (more) { 
            // end
            // HTML // begin [file="/test.jsp";from=(22,23);to=(24,6)]
                out.write("\r\n      <tr>\r\n      ");

            // end
            // begin [file="/test.jsp";from=(24,8);to=(24,44)]
                 for (int k = 1; k <= colnum; k++){ 
            // end
            // HTML // begin [file="/test.jsp";from=(24,46);to=(25,14)]
                out.write("\r\n         <td> ");

            // end
            // begin [file="/test.jsp";from=(25,16);to=(25,45)]
                out.print(rs.getString(k));} 
            // end
            // HTML // begin [file="/test.jsp";from=(25,47);to=(26,8)]
                out.write("\r\n        ");

            // end
            // begin [file="/test.jsp";from=(26,10);to=(26,29)]
                 more = rs.next(); 
            // end
            // HTML // begin [file="/test.jsp";from=(26,31);to=(28,1)]
                out.write("\r\n       </tr>\r\n ");

            // end
            // begin [file="/test.jsp";from=(28,3);to=(30,0)]
                 }
                   rs.close();
            // end
            // HTML // begin [file="/test.jsp";from=(30,2);to=(37,0)]
                out.write("\r\n</table>\r\n</center>\r\n\r\n\r\n</body>\r\n</html>\r\n");

            // end

        } catch (Throwable t) {
            if (out != null && out.getBufferSize() != 0)
                out.clearBuffer();
            if (pageContext != null) pageContext.handlePageException(t);
        } finally {
            if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -