?? jiangpai_jsp.java
字號(hào):
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;
public final class jiangpai_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
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");
out.write("<head>\n");
out.write("<title>新聞中心</title>\n");
out.write("<link href=\"css2.css\" rel=\"stylesheet\" type=\"text/css\" />\n");
out.write("</head>\n");
out.write("<body>\n");
out.write("<div id=\"container\">\n");
out.write(" <div id=\"Header\">\n");
out.write(" </div>\n");
out.write(" ");
String sql = "select * from jiangpai;"; Statement stmt=null; PreparedStatement pstmt=null; ResultSet rs=null; //加載JDBC-ODBC橋驅(qū)動(dòng) try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); //定義JDBC URL }catch (Exception e) { out.println(e.getMessage()); } try{ String url = "jdbc:odbc:s"; //得到與數(shù)據(jù)庫的連接 Connection con = DriverManager.getConnection(url); //顯示UPL和連接信息 System.out.print("URL:" + url); System.out.print("Connection:" + con); //得到一個(gè)Statement對(duì)象 stmt = con.createStatement(); //執(zhí)行SQL語句 System.out.print("SQL:" + sql); ResultSet p = stmt.executeQuery(sql); ResultSetMetaData meta = p.getMetaData();
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("<table width=600 border=\"2\" cellpadding=\"2\" cellspacing=\"3\" bgcolor=#E2F5BC >\n");
out.write("<tr bgcolor=#6681D9 >\n");
out.write("<td height=20 colspan=5>\n");
out.write("<div ><font SIZE=\"20\" color=\"red\">實(shí)時(shí)獎(jiǎng)牌榜</font>\n");
out.write("</td>\n");
out.write("</tr>\n");
out.write("<tr bgcolor=#D9E0F9 >\n");
out.write("<td ><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("<td ><font color=\"#309aff\">銅牌</font></td>\n");
out.write("<td ><font color=\"#309aff\">獎(jiǎng)牌總數(shù)</font></td>\n");
out.write("</tr>\n");
out.write(" ");
while(p.next()) { out.print("<td > "+p.getString("con")+"</td>"); out.print("<td > "+p.getString("jinpai")+"</td>"); out.print("<td > "+p.getString("yinpai")+"</td>"); out.print("<td > "+p.getString("tongpai")+"</td>"); out.print("<td> "+p.getString("zhongshu")+"</td></tr>"); } } catch (Exception e) {}
out.write("</table>\n");
out.write("<a href=\"xw.jsp\">返回新聞中心主頁</a>\n");
out.write("</body>\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);
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -