📄 news.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="java.util.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>南昌公交查询网</title>
<style type="text/css">
<!--
body {
background-image: url();
margin-left: 100px;
margin-right: 100px;
margin-top: 0px;
margin-bottom: 0px;
background-color: #999999;
}
.STYLE4 {font-size: 14px}
.STYLE7 {font-weight: bold}
.STYLE2 {font-weight: bold}
.style11 {font-size: smaller}
.style13 {font-size: small; font-weight: bold; }
.style6 {font-size: small}
a:link {
color: #000000;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: none;
color: #FF0000;
}
a:active {
text-decoration: none;
color: #FF0000;
}
-->
</style></head>
<body>
<%
String statement="";
ResultSet result;
Connection con; //声明一个连接
int counta=0;
int countf=0;
String anoucement[]=new String[100];
String a_date[]=new String[100];
String fastnews[]=new String[100];
String f_date[]=new String[100];
int typeid=0;
String title="";
String posttime="";
//加载数据源
try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(ClassNotFoundException e){}
try{
con=DriverManager.getConnection("jdbc:odbc:nbos","","");
Statement sql=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
statement="select * from News order by NewsID DESC";
result=sql.executeQuery(statement);
while(result.next())
{ typeid=result.getInt("Type");
title=result.getString("Title");
posttime=result.getString("PostTime");
if(typeid==0)
{
anoucement[counta]=title;
a_date[counta]=posttime;
counta++;
}
else
{
fastnews[countf]=title;
f_date[countf]=posttime;
countf++;
}
}
result.close();
} catch(Exception e) { }
%>
<table width="802" height="546" border="0" bgcolor="#FFFFFF">
<tr>
<td height="181" colspan="5"><table width=800 height="179" border=0 align=center cellpadding=0 cellspacing=0 bordercolor="#FFFFFF">
<tbody>
<tr>
<td height="30" colspan="7" bordercolor="#FF0000"><img src="Picture/top.files/top2004-p1.jpg" width="800" height="30"></td>
</tr>
<tr>
<td height="30" colspan="7" bordercolor="#FF0000"><img src="Picture/top.files/top2004-p2.jpg" width="800" height="30"></td>
</tr>
<tr>
<td height="41" colspan="7" bordercolor="#FF0000"><img src="Picture/top.files/top2004-p3.jpg" width="800" height="41"></td>
</tr>
<tr>
<td height="35" colspan="7" bordercolor="#FF0000"><img src="Picture/top.files/top2004-p4.jpg" width="800" height="35"></td>
</tr>
<tr>
<td width=205
height=13 background="Picture/topbg.gif">
<p align=left> <font style="FONT-FAMILY: Verdana"
color=#ffffff>
<script language=JavaScript class=black
src="css/date.js"></script>
</font></p></td>
<td width="87" bordercolor="#FF0000" background="Picture/topbg.gif"><span class="style6">
<div align="center" class="style6"> <a href="http://www.0951.cc/tel/" target="_blank"><strong><strong></strong></strong></a><a href="homepage.jsp" target="_self"><strong><strong>|首页</strong></strong><strong>|</strong></a></div>
<a href="default.html" target="mainFrame"> </a><a href="http://www.0951.cc/adxx/tielu/" target="_blank">
<div align="center" class="style13"></div>
</a></span></td>
<td width="105" bordercolor="#FF0000" background="Picture/topbg.gif"><span class="style6"><a href="index.jsp" target="_self">
<div align="center" class="style13">|本站导航|</div>
</a></span></td>
<td width="99" bordercolor="#FF0000" background="Picture/topbg.gif"><div align="center" class="style13">|<a href="advancequery.jsp">高级搜索</a>|</div></td>
<td width="88" bordercolor="#FF0000" background="Picture/topbg.gif"><div align="center" class="style6"><strong><strong>|<a href="news.jsp">公交新闻</a>|</strong></strong></div></td>
<td width="103" bordercolor="#FF0000" background="Picture/topbg.gif"><div align="center" class="style6"><a href="messages.jsp"><strong>|留言板|</strong></a></div></td>
<td width="113" bordercolor="#FF0000" background="Picture/topbg.gif"><div align="center" class="style6"><strong><a href="login.html" target="_parent">|系统维护|</a></strong></div></td>
</tr>
<tr>
<td
height=24 colspan="3" background="Picture/l33.gif" bgcolor="#6699FF"><marquee onMouseOver="fhhg" >
<code><strong>网内公告:欢迎访问南昌公交查询网站!</strong> </code>
</marquee> </td>
<td
height=24 colspan="4" background="Picture/l33.gif" bgcolor="#FFFFFF"><div align="right" class="style6"><span class="style11"><a href="#" class=Bottom onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://localhost:8080/nbos/homepage.jsp');">|设为首页|</a><a href="javascript:window.external.AddFavorite('http://localhost:8080/nbos/homepage.jsp','南昌公交查询网')">加入收藏|</a><a href="mailto:software_wei@163.com" class=Bottom>联系站长</a><a href="mailto:software_wei@163.com" class=Bottom>|</a></span></div></td>
</tr>
</tbody>
</table></td>
</tr>
<tr >
<td width="77" height="282" rowspan="2" bgcolor="#e8f3ff"> </td>
<td width="310" height="19" background="Picture/ey_591top6.gif"> <span class="STYLE2">最新公告</span></td>
<td width="5" rowspan="2" bgcolor="#e8f3ff"> </td>
<td width="315" background="Picture/ey_591top6.gif"><div align="left"> <span class="STYLE2">新闻快递</span></div></td>
<td width="77" rowspan="2" bgcolor="#e8f3ff"> </td>
</tr>
<tr >
<td width="310"><table width="304" height="269" border="0">
<% for(int i=0;i<counta;i++) { %>
<tr>
<td width="20" height="17"><img src="Picture/enter.jpg" width="20" height="15"></td>
<td width="167" class="style6"><a href="newscontent.jsp?title=<%=anoucement[i]%>" target="_blank"><%=anoucement[i]%></a></td>
<td width="103">(<span class="style6"><%=a_date[i]%></span>)</td>
</tr>
<% } %>
<tr>
<td height="238"> </td>
<td> </td>
<td> </td>
</tr>
</table></td>
<td width="315" height="272" bordercolor="0"><table width="315" height="269" border="0">
<% for(int j=0;j<countf;j++)
{ %>
<tr>
<td width="21" height="15"><img src="Picture/enter.jpg" width="20" height="15"></td>
<td width="181" class="style6"><a href="newscontent.jsp?title=<%=fastnews[j]%>" target="_blank"><%=fastnews[j]%></a></td>
<td width="124">(<span class="style6"><%=f_date[j]%></span>)</td>
</tr>
<% } %>
<tr>
<td height="246"> </td>
<td> </td>
<td> </td>
</tr>
</table></td>
</tr>
<tr >
<td height="38" colspan="5" background="Picture/mainbottom.jpg"> <div align="center"></div></td>
</tr>
<tr background="Picture/topBar_bg.gif">
<td height="24" colspan="5"><div align="center"><span class="css">Copyright © 南昌公交查询网. All rights reserved 2007-2010</span></div></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -