⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adminsearch.jsp

📁 这个是使用JSP、JDBC技术构架一个关于JAVA语言的BBS讨论区
💻 JSP
字号:
<%--
File Name:search.jsp
Author:fancy
Date:2001.6.1
Usage:search the topic
Address:Peking University 37#215,62762526,fancyrainbow@263.net,bbs.pku.edu.cn(id:javalover)
Note:1.这是一个Open Source项目,你可以自由的获取,修改,传播本项目的代码,无需经过本人的同意。
     2.你不可以将本项目的源代码用于商业应用,除非获得本人的书面允许。
     3.本项目的核心源代码所有权归原开发者所有,如果需要获取最新的核心代码,请与本人联系
--%>
<%
String topic=request.getParameter("topic"); 
String author=request.getParameter("author");
if(topic==null)
{
	topic="";
}
if(author==null)
{
	author="";
}
%>

<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Java论坛</title>
</SCRIPT>
</head>
<%@ include file="defaultcss.jsp"%>
<%@ include file="menuaction.jsp"%>
<%@ include file="database.jsp" %>

<%
java.sql.Statement stmtsearch=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
String SQL="SELECT * FROM data WHERE topic like"+" '%"+topic+"%' and author like "+" '%"+author+"%' ORDER BY id DESC";
//out.println(SQL);
ResultSet rslist=stmtsearch.executeQuery(SQL);
rslist.last();
int count=rslist.getRow();
if(count==-1)
	count=0;
rslist.first();
rslist.close();
rslist=stmtsearch.executeQuery(SQL);
%>

<%
String prevlink="";
String nextlink="";
String firstlink="";
String lastlink="";
String editlink="";
String deletelink="";
String backlink="";

//设定Session,可能用不上,临时的
session.putValue("prevlink",prevlink);
session.putValue("nextlink",nextlink);
session.putValue("firstlink",firstlink);
session.putValue("lastlink",lastlink);
session.putValue("editlink",editlink);
session.putValue("deletelink",deletelink);
session.putValue("backlink",backlink);
%>


<body LANGUAGE=javascript onload="return window_onload()">
<table border="0" width="100%" height="521" cellspacing="0" cellpadding="0">
  <%@ include file="admintoptable.jsp"%>
  <tr>
    <td width="2%" height="13"></td>
    <td width="92%" height="32" colspan="5" rowspan="2">
      <div align="center">
        <center>
        <table border="0" cellpadding="0" cellspacing="0" width="80%" height="26">
          <tr bgcolor="#efefef">
            <td width="25%" height="24"></td>
            <td width="50%" height="24"  align="center"><font color="red" size="2">Java技术讨论区(查询文章)</font></td>
            <td width="25%" height="24"></td>
          </tr>
	  <tr bgcolor="#DCEDED">
            <td width="25%" height="24"></td>
            <td width="50%" height="24"  align="center"><font color="red" size="2">共查找到合适的纪录<%=count%>条</font></td>
            <td width="25%" height="24"></td>
          </tr>
        </table>
        </center>
      </div>
    </td>
  </tr>
  <tr><td width="2%" height="13"></td></tr>
  <tr>
    <td width="2%" height="16"></td>
    <td width="2%" height="284" rowspan="18" background="img/shu.gif"> </td>
    <td width="92%" height="284" colspan="5" rowspan="18">
      <div align="center">
        <center>
        <table border="0" cellpadding="0" cellspacing="1" width="99%" height="246">
          <tr bgcolor='#DCEDED'>
	    <td width='10%' height='29' align='center'><font color='blue'size='2'>编号</font></td>
	    <td width='40%' height='29'><font color='blue'size='2'>主题</font></td>
	    <td width='18%' height='29' align='center'><font color='blue'size='2'>作者</font></td>
	    <td width='7%' height='29' align='center'><font color='blue'size='2'>回文数</font></td>
	    <td width='25%' height='29' align='center'><font color='blue'size='2'>发表时间</font></td>
	  </tr>
	  <%
	  int i=0;
	  while(rslist.next())
	  {
		int id=rslist.getInt(13);
	  %>
	  <tr bgcolor='#efefef'>
	    <td width='10%' height='29'><font size='2' color='blue'><%=id%></font></td>
	    <td width='40%' height='29'><font size='2' color='blue'><a href="adminview.jsp?id=<%=id%>"><%=rslist.getString(1)%></a></font></td>
	    <td width='18%' height='29'><font size='2' color='blue'><a href="adminviewuser.jsp?key=<%=rslist.getString(4)%>"><%=rslist.getString(4)%></a></font></td>
	    <td width='7%' height='29'><font size='2' color='blue'><%=rslist.getInt(11)%></font></td>
	    <td width='25%' height='29'><font size='2' color='blue'><%=rslist.getDate(7)%></font></td>
          </tr>
	  <%
		i++;
	  }
	  rslist.close();
	  %>
	</table>
        </center>
      </div>
    </td>     
    <td width="2%" height="284" rowspan="18"></td>     
    <td width="2%" height="284" rowspan="18" background="img/shu.gif"> </td>
  </tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="16"></td></tr>
  <tr><td width="2%" height="12"></td></tr>
  <tr>
    <td width="2%" height="41" rowspan="2"></td>
    <td width="2%" height="41" background="img/shu.gif" rowspan="2"></td>
    <td width="92%" height="27" colspan="5"></td>
    <td width="2%" height="41" rowspan="2" background="img/shu.gif"></td>
    <td width="2%" height="41" background="img/shu.gif" rowspan="2"></td>
  </tr>
  <tr>
    <td width="92%" height="18" colspan="5" background="img/bottom.gif"> </td>
  </tr>
</table> 
<%@ include file="adminmenu.jsp"%>				      
<%
conn.close();
%>
</body>                                
<html>                                

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -