news0202.jsp
资源名称:wapjsp.rar [点击查看]
上传用户:xiao85513
上传日期:2010-01-11
资源大小:2160k
文件大小:1k
源码类别:
手机WAP编程
开发平台:
Java
- <%@ page contentType="text/vnd.wap.wml" import="java.sql.*" language="java"%> <?xml version="1.0" encoding="gb2312"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
- <wml> <head> <meta forua="true" http-equiv="Cache-Control" content="max-age=0"/> </head> <card id="news" title="news" newcontext="true">
- <do type="prev" name="Prev" label="Back"><prev/></do>
- <%Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
- String url="jdbc:microsoft:sqlserver://172.0.0.1;DatabaseName=herald";
- String user="sa";
- String password="kurtCobain4551306";
- Connection conn=DriverManager.getConnection(url,user,password);
- Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
- String sql="select top 7
- NewsID,Title,UpdateTime,BigClassName,SmallClassName,SpecialID,click from News where
- BigClassName='" & BigClassName &"' order by NewsID DESC";
- ResultSet rs1=stmt.executeQuery(sql);
- while(rs1.next()){%>
- <%=rs1.getString("NewsID")%>
- <%=rs1.getString("BigClassName")%>
- <%=rs1.getString("SmallClassName")%>
- <%=rs1.getString("SpecialId")%>
- <%=rs1.getString("Title") %>
- <%}rs.close();%>
- <br/><a href="index.wml">返回主页</a><br/> </card> </wml>