aaaaa.jsp
上传用户:xiao85513
上传日期:2010-01-11
资源大小:2160k
文件大小:1k
源码类别:

手机WAP编程

开发平台:

Java

  1. <%@ page contentType="text/html" import="java.sql.*" language="java"%>
  2. <html> <head> <meta forua="true" http-equiv="Cache-Control" content="max-age=0"/> </head>
  3. <%Class.forName("org.gjt.mm.mysql.Driver").newInstance();
  4.     String url ="jdbc:mysql://127.0.0.1/gonggao?user=nangua&password=2003herald&useUnicode=true&characterEncoding=8859_1";
  5.     Connection con= DriverManager.getConnection(url);
  6.     Statement statement=con.createStatement();
  7.     ResultSet rs=statement.executeQuery("select ID,title,updatetime from gongbao");     int i=1;     while(rs.next()){ %>
  8. <a href="subgonggao.jsp?ID=<%=rs.getString("ID")%>" accesskey="<%=i%>"><%=i%>.<%=rs.getString("title")%></a><%=rs.getString("updatetime")%><br/>
  9. <%i++;}rs.close();%>            <br/><a href="index.wml">返回主页</a><br/> </html>