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

📄 _6_jsp.java

📁 JAVA实验图形 =各种 的 JAVA简单代码 出初学者必备!!!!!!!!!
💻 JAVA
字号:
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;
import java.io.*;

public final class _6_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

 String file; 
  private static java.util.Vector _jspx_dependants;

  public java.util.List getDependants() {
    return _jspx_dependants;
  }

  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;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html; charset=GBK");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write('\n');
      out.write('\n');
request.setCharacterEncoding("gb2312");
      out.write("\n");
      out.write("<html>\n");
      out.write("<head>\n");
      out.write("<title>新闻中心搜索结果</title>\n");
      out.write("</head>\n");
      out.write("<link href=\"2.css\" rel=\"stylesheet\" type=\"text/css\" />\n");
      out.write("<html><center><body>\n");
      out.write(" <div id=\"Header\"></div>\n");
      out.write('\n');
      out.write(' ');
String id;String sql = " select   *   from   s";        Statement stmt=null;        PreparedStatement pstmt=null;        ResultSet rs=null;        //加载JDBC-ODBC桥驱动        try {            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");            //定义JDBC URL        }catch (Exception e) {        out.println(e.getMessage());        }          try{            String url = "jdbc:odbc:s";            //得到与数据库的连接            Connection con = DriverManager.getConnection(url);            //显示UPL和连接信息            System.out.print("URL:" + url);            System.out.print("Connection:" + con);            //得到一个Statement对象            stmt = con.createStatement();            //执行SQL语句            System.out.print("SQL:" + sql);            ResultSet p = stmt.executeQuery(sql);            ResultSetMetaData meta = p.getMetaData();            
      out.write("\n");
      out.write("<table width=1200 border=\"2\" cellpadding=\"1\" cellspacing=\"3\" bgcolor=#6681D9 >\n");
      out.write("<tr bgcolor=#6681D9 >\n");
      out.write("<td height=20 colspan=9>\n");
      out.write("<div ><center>后台管理</center>\n");
      out.write("</td>\n");
      out.write("</tr>\n");
      out.write("<tr bgcolor=#D9E0F9>\n");
      out.write("<td align=center><font color=\"#309aff\">教材号</font></td>\n");
      out.write("<td align=center><font color=\"#309aff\">教材名</font></td>\n");
      out.write("<td align=center><font color=\"#309aff\">教材单价</font></td>\n");
      out.write("<td align=center><font color=\"#309aff\">教材出版社</font></td>\n");
      out.write("<td align=center><font color=\"#309aff\">教材余额</font></td>\n");
      out.write("<td align=center><font color=\"#309aff\">教材图片</font></td>\n");
      out.write("<td align=center><font color=\"#309aff\">教材说明</font></td>\n");
      out.write("<td ><font color=\"#309aff\">修改</font></td>\n");
      out.write("<td><font color=\"#309aff\">删除</font></td>\n");
      out.write("</tr>\n");
      out.write("  ");
              while(p.next())             {           file=p.getString("filename");           id=p.getString("bnum");               out.print("<td align=center> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+id+"</td>");               out.print("<td align=center>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+p.getString("bname")+"</td>");               out.print("<td align=center>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+p.getString("bjiage")+"</td>");               out.print("<td align=center>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+p.getString("cbs")+"</td>");               out.print("<td align=center>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+p.getString("booknum")+"</td>");               out.print("<td align='center'><img   src='"+file+"'   </td>");               out.print("<td align=center>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+p.getString("shuoming")+"</td>");out.print("<td><a href='6xiugai.jsp?num="+id+"'>修   改</a> </td>");out.print("<td> <a href='7shanchu.jsp?id="+id+"'>删  除</a> </td></tr>");             }            } catch (Exception e) {}
      out.write("</table>\n");
      out.write("<input type=\"button\"  name   =   \"a\"   value   = \"返回\" onclick   =  \"javacscript:history.back()\"><a href=\"jsp2.jsp\">返回主页</a><br>\n");
      out.write("</body></html>\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}

⌨️ 快捷键说明

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