topnews.jsp
上传用户:szlmxq
上传日期:2014-01-31
资源大小:740k
文件大小:3k
源码类别:

Applet

开发平台:

Java

  1. <%@ page contentType="text/html;charset=GBK" language="java" import="java.sql.*" errorPage="" %>
  2. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  3.                                 <!--DWLayoutTable-->
  4.                                 <tr> 
  5.                                   <td width="107" height="74">&nbsp;</td>
  6.                                   <td width="165" align="center" valign="top"> 
  7.                                     <table width="165" border="0" cellspacing="0" cellpadding="0">
  8.                                       <!--DWLayoutTable-->
  9.                                       <tr> 
  10.                                         <td valign="top" align="center" bgcolor="#FFFFFF"> 
  11.                                            </td>
  12.                                       </tr>
  13.                                       <tr> 
  14.                                         <td valign="top" align="center"> <img border="0" src="img/promo_list_top.gif" width="100%" height="4"></td>
  15.                                       </tr>
  16.                                       <tr> 
  17.                                         <td valign="top" align="center" bgcolor="#DBC2B0">最新新闻</td>
  18.                                       </tr>
  19.                                       <tr> 
  20.                                         <td valign="top"> 
  21.                                           <%              
  22. sql="select top 10 * from news order by news_id DESC" ;
  23. rs=mdb.executeQuery(sql);
  24. if(!rs.next())
  25. {
  26.   out.print("暂且没有新闻");         
  27. }else
  28. { rs.previous();      
  29.    while(rs.next()){
  30.    %>
  31.                                           <img src="img/dot.gif" width="15" height="15"> 
  32.                                           <a href="news.jsp?news_id=<%=rs.getInt("news_id")%>" target="_blank"><%=rs.getString("news_title")%></a> 
  33.                                           <br> 
  34.                                           <%           
  35.    }        
  36. }       
  37.          
  38.   
  39.                 %>
  40.                                         </td>
  41.                                       </tr>
  42.                                       <tr> 
  43.                                         <td valign="top" align="right"> <a href="allnews.jsp" target="_blank"><img src="img/pics/more.gif" width="45" height="10" border="0"></a></td>
  44.                                       </tr>
  45.                                     </table></td>
  46.                                   <td width="107">&nbsp;</td>
  47.                                 </tr>
  48.                               </table>