📄 resultquery2.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="java.util.*" %>
<!-- saved from url=(0049)http://www.nxsq.com/bus/buffer/busIDInfo/bus4.htm -->
<HTML><HEAD><TITLE>车次查询</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<STYLE type=text/css>BODY {
FONT-SIZE: 13px; FONT-FAMILY: 宋体; TEXT-ALIGN: center
}
TR {
FONT-SIZE: 13px; FONT-FAMILY: 宋体; TEXT-ALIGN: center
}
TD {
FONT-SIZE: 13px; FONT-FAMILY: 宋体; TEXT-ALIGN: center
}
a:link {
color: #0000FF;
}
a:visited {
color: #993300;
}
a:hover {
color: #FF0000;
}
a:active {
color: #FF0000;
}
</STYLE>
<META content="MSHTML 6.00.2900.2995" name=GENERATOR></HEAD>
<BODY>
<% Connection con;
String statement="";
ResultSet result;
String Station=new String(request.getParameter("query2").getBytes("ISO8859_1"),"GBK");
int count=0;
String stations[]=new String[100]; //用来存放某一路线的所有站点
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 bus where Detail LIKE '%"+Station+"%' order by Sort ASC" ;
result=sql.executeQuery(statement);
if(!result.next())
{
response.sendRedirect("errorquery2.jsp");
}
else
{
result.previous();
%>
<TABLE cellSpacing=1 cellPadding=3 width=650 align=center bgColor=#003399
border=0>
<TBODY>
<TR>
<TD background=Picture/topbg.gif height=20></TD>
</TR>
<TR bgColor=#7da4ec>
<TD><STRONG><FONT color=#ffffff>站点查询结果</FONT></STRONG></TD>
</TR>
<TR bgColor=#e8f3ff>
<TD><!--查询结果显示开始-->
<TABLE width=500 height="84" border=0 cellPadding=3 cellSpacing=1 bgColor=#003399>
<TBODY>
<TR bgColor=#fddd90>
<TD height="19" colspan="2">查询的站点名:<STRONG><font color="#FF0000"><%=Station%></font></STRONG></TD>
</TR>
<TR bgColor=#fddd90>
<TD width=73 height="19">车次号</TD>
<TD width="412">经过的所有站点</TD>
</TR>
<% while(result.next())
{ String BusID=result.getString("BusID");
String Detail=result.getString("Detail");
StringTokenizer str1=new StringTokenizer(Detail,"->");
count=0;
while(str1.hasMoreTokens())
{ stations[count]=str1.nextToken();
count++;
}//endwhile
%>
<TR onmouseover="this.style.backgroundColor = '#FFF9EE'"
onmouseout="this.style.backgroundColor = ''" bgColor=#e8f3ff>
<TD height="42"><a href="resultquery1.jsp?query1=<%=BusID%>" target="_blank"><%=BusID%></a></TD>
<TD>
<div align="left">
<%
for(int i=0;i<count;i++)
{ if(stations[i].indexOf(Station)!=-1)
{ %>
<font color="#FF0000"><%=stations[i]%> </font>
<% }//endif
else { %>
<font size="2"><%=stations[i]%> </font>
<%
}//endelse
}//endfor
%>
</div></TD></TR>
<% }//endwhile
}//end else
result.close();}
catch(SQLException e1){}
%>
</TBODY></TABLE>
<!--查询结果显示结束--><BR><IMG
src="Picture/close_window.gif" width="78" height="21" border=0
style="CURSOR: hand" onclick=window.close()> </TD>
</TR>
<TR>
<TD background=Picture/bottombg.gif
height=20></TD>
</TR></TBODY></TABLE></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -