<%@ page contentType="text/html;charset=GBK" %>
<%@ page language="java" import="java.sql.*" %>
<%@ page import="java.lang.Math.*" %>
<jsp:useBean id="conn" scope="page" class="news.conn"/>
<%!
String id = "";
String sql = "";
ResultSet rs = null;
ResultSet rsTmp = null;
%>
<html>
<head>
<title>新闻</title>
<link rel="stylesheet" type="text/css" href="news.css">
</head>
<%
id = request.getParameter("id");
sql="SELECT * from news where ID=" + id;
rs = conn.executeQuery( sql );
if(!rs.next()) {
	out.println("错误的ID号");
	rs.close();
}else {
	%>
	<table width="100%" HEIGHT=100% border="1" cellspacing="0" cellpadding="0" bordercolorlight="#000000" bordercolordark="#FFFFFF">
	  <tr bgcolor="#FAD195"> 
		<td height=20 align=center><b><%=rs.getString("title")%></b></td>
	  </tr>
	  <tr> 
		<td valign=top>
		<p><%=rs.getString("content")%>
	</tr>
	</table>
	<br><b>相关新闻：</b><ul>
	<%
	sql="SELECT * from news where ID<>"+id+" and keywords='" + rs.getString("keywords")+"' order by ID desc";
	rs.close();
	rs = conn.executeQuery(sql);
	while(rs.next()) {
	%>
		<li><a href=newswind.jsp?id=<%=rs.getInt("ID")%>><u>
		<%=rs.getString("title")%></u></a>--
		<%=rs.getString("author")%>
		【<%=rs.getDate("times").toString()%>】
	<%
	}
	rs.close();
}
%>
</ul>
</html>
