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

📄 search.jsp~5~

📁 这是一个图书馆管理系统的jsp代码
💻 JSP~5~
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!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>Search</title>
<style type="text/css">
<!--
.style3 {font-size: 24px}
.style4 {font-size: 18px}
-->
</style></head>

<body>
<jsp:useBean id="Library" scope="session" class="login.Library">
</jsp:useBean>
<%
int statbooknumber=0,statinbooknumber=0,statoutbooknumber=0,statprizenumber=0,aveprizenumber=0,temp1=0,temp2=0,temp3=0,temp4=0;


try{
  Connection conn=Library.getConn();
  Statement stmt=conn.createStatement();
  ResultSet rs = stmt.executeQuery("select * from book");
  while(rs.next()){
    temp1=Integer.parseInt(rs.getString("innumber"));
    temp2=Integer.parseInt(rs.getString("outnumber"));
    temp3=Integer.parseInt(rs.getString("prize"));
    statinbooknumber=statinbooknumber+temp1;
    Library.setstatinbooknumber(statinbooknumber);
    statoutbooknumber=statoutbooknumber+temp2;
    Library.setstatoutbooknumber(statoutbooknumber);
    temp4=temp3*(temp1+temp2);
    statprizenumber=statprizenumber+temp4;
    Library.setstatprizenumber(statprizenumber);
  }
  statbooknumber=statinbooknumber+statoutbooknumber;
  Library.setstatbooknumber(statbooknumber);
  aveprizenumber=statprizenumber/statbooknumber;
  Library.setaveprizenumber(aveprizenumber);
 /* if(request.getParameter("statbook")!=null){
    out.println("<p>statbook = " + statbooknumber +"&nbsp; </p>");}
    else if(request.getParameter("statinbook")!=null){
      out.println("<p>statinbook = " + statinbooknumber +"&nbsp; </p>");}
      else if(request.getParameter("statoutbook")!=null){
        out.println("<p>statoutbook = " + statoutbooknumber +"&nbsp; </p>");}
        else if(request.getParameter("statprize")!=null){
          out.println("<p>statprize = " + statprizenumber +"&nbsp; </p>");}
          else if(request.getParameter("aveprize")!=null){
            out.println("<p>aveprize = " + aveprizenumber +"&nbsp; </p>");}*/
          }catch (Exception ex){
          response.sendRedirect("fail.jsp");
ex.printStackTrace();}
%>
<form name="form1" method="post" action="">
  <table border="0" cellpadding="0" cellspacing="0">
    <tr align="left" valign="top" bgcolor="#000000">
      <td height="100" colspan="2"><table width="100%" border="0" align="left" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
        <tr>
          <td bgcolor="#FFFFFF"><img src="F:\example\图书馆\login\library1.gif" width="699" height="100" alt=""></td>
        </tr>
      </table></td>
    </tr>
    <tr>
      <td height="449" align="left" valign="top" bgcolor="#000000"><table width="99%" border="0" align="left" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
        <tr>
          <td valign="top" bgcolor="#CCCCCC"><table width="70%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
            <tr>
              <td width="20" align="right">&nbsp;</td>
              <td width="130" align="center">&nbsp;</td>
            </tr>
            <tr>
              <td width="20" align="right"><img src="F:\example\图书馆\login/library3.png" width="10" height="10" alt=""></td>
              <td width="130" align="center"> <a href="adduser.jsp">Adduser</a> </td>
            </tr>
            <tr>
              <td width="20" height="5" align="right">&nbsp;</td>
              <td width="130" height="5" align="center"><img src="F:\example\图书馆\login/library4.png" width="102" height="5" alt=""></td>
            </tr>
            <tr>
              <td width="20" align="right"><img src="F:\example\图书馆\login/library3.png" width="10" height="10" alt=""></td>
              <td width="130" align="center"><a href="modifyuser.jsp">Modifyuser</a></td>
            </tr>
            <tr>
              <td width="20" height="5" align="right">&nbsp;</td>
              <td width="130" height="5" align="center"><img src="F:\example\图书馆\login/library4.png" width="102" height="5" alt=""></td>
            </tr>
            <tr>
              <td width="20" align="right"><img src="F:\example\图书馆\login/library3.png" width="10" height="10" alt=""></td>
              <td width="130" align="center"><a href="deleteuser.jsp">Deletuser</a></td>
            </tr>
            <tr>
              <td width="20" align="right">&nbsp;</td>
              <td width="130" align="center"><img src="F:\example\图书馆\login/library4.png" width="102" height="5" alt=""></td>
            </tr>
            <tr>
              <td width="20" align="right"><img src="F:\example\图书馆\login/library3.png" width="10" height="10" alt=""></td>
              <td width="130" align="center"><a href="searchuser.jsp">Searchuser</a></td>
            </tr>
            <tr>
              <td width="20" align="right">&nbsp;</td>
              <td width="130" align="center"><img src="F:\example\图书馆\login/library4.png" width="102" height="5" alt=""></td>
            </tr>
            <tr>
             <td width="20" align="right"><img src="F:\example\图书馆\login/library3.png" width="10" height="10" alt=""></td>
              <td width="130" align="center"><a href="addbook.jsp">Addbook</a></td>
            </tr>
            <tr>
              <td width="20" align="right">&nbsp;</td>
              <td width="130" align="center"><img src="F:\example\图书馆\login/library4.png" width="102" height="5" alt=""></td>
            </tr>
            <tr>
              <td align="right"><img src="F:\example\图书馆\login/library3.png" width="10" height="10" alt=""></td>
              <td align="center"><a href="deletebook.jsp">Deletebook</a></td>
            </tr>
            <tr>
              <td align="right">&nbsp;</td>
              <td align="center"><img src="F:\example\图书馆\loginlibrary4.png" width="102" height="5" alt=""></td>
            </tr>
            <tr>
              <td align="right"><img src="F:\example\图书馆\login/library3.png" width="10" height="10" alt=""></td>
              <td align="center"><a href="borrowsearch.jsp">Borrowsearch</a></td>
            </tr>
            <tr>
              <td align="right">&nbsp;</td>
              <td align="center"><img src="F:\example\图书馆\login/library4.png" width="102" height="5" alt=""></td>
            </tr>
            <tr>
              <td align="right"><img src="F:\example\图书馆\login/library3.png" width="10" height="10" alt=""></td>
              <td align="center"><a href="search.jsp">Search</a></td>
            </tr>
            <tr>
              <td align="right">&nbsp;</td>
              <td align="center"><img src="F:\example\图书馆\login/library4.png" width="102" height="5" alt=""></td>
            </tr>
            <tr>
              <td width="20" align="right">&nbsp;</td>
              <td width="130" align="center">&nbsp;</td>
            </tr>
          </table></td>
        </tr>
        <tr>
          <td height="230" valign="top" bgcolor="#CCCCCC">&nbsp;</td>
        </tr>
      </table></td>
      <td height="449" align="left" valign="top"><table width="80%" border="1" align="center" cellpadding="10" cellspacing="1">
        <tr align="center">
          <td height="50" colspan="2"><span class="style3">Search </span></td>
          </tr>
        <tr>
          <td width="30%" height="30" align="right" class="style4">StatBook:</td>
          <td height="30" align="left" class="style4"><%=Library.getstatbooknumber() %></td>
        </tr>
        <tr>
          <td width="30%" height="30" align="right" class="style4">StateInBook:</td>
          <td height="30" align="left" class="style4"><%=Library.getstatinbooknumber() %></td>
        </tr>
        <tr>
          <td width="30%" height="30" align="right" class="style4">StateOutBook:</td>
          <td height="30" align="left" class="style4"><%=Library.getstatoutbooknumber() %></td>
        </tr>
        <tr>
          <td width="30%" height="30" align="right" class="style4">StatPrize:</td>
          <td height="30" align="left" class="style4"><%=Library.getstatprizenumber() %></td>
        </tr>
        <tr>
          <td width="30%" height="30" align="right" class="style4">AvePrize:</td>
          <td height="30" align="left" class="style4"><%=Library.getaveprizenumber() %></td>
        </tr>
      </table></td>
    </tr>
    <tr>
      <td bgcolor="#666666">&nbsp;</td>
      <td><img src="F:\example\图书馆\login/library2.png" width="573" height="40" alt=""></td>
    </tr>
  </table>
</form>
<!--
<jsp:useBean id="Library" scope="session" class="login.Library">
</jsp:useBean>-->
<center>
<%
/*int statbooknumber=0,statinbooknumber=0,statoutbooknumber=0,statprizenumber=0,aveprizenumber=0,temp1=0,temp2=0,temp3=0,temp4=0;


try{
  Connection conn=Library.getConn();
  Statement stmt=conn.createStatement();
  ResultSet rs = stmt.executeQuery("select * from book");
  while(rs.next()){
    temp1=Integer.parseInt(rs.getString("innumber"));
    temp2=Integer.parseInt(rs.getString("outnumber"));
    temp3=Integer.parseInt(rs.getString("prize"));
    statinbooknumber=statinbooknumber+temp1;
    statoutbooknumber=statoutbooknumber+temp2;
    temp4=temp3*(temp1+temp2);
    statprizenumber=statprizenumber+temp4;
  }
  statbooknumber=statinbooknumber+statoutbooknumber;
  aveprizenumber=statprizenumber/statbooknumber;
  if(request.getParameter("statbook")!=null){
    out.println("<p>statbook = " + statbooknumber +"&nbsp; </p>");}
    else if(request.getParameter("statinbook")!=null){
      out.println("<p>statinbook = " + statinbooknumber +"&nbsp; </p>");}
      else if(request.getParameter("statoutbook")!=null){
        out.println("<p>statoutbook = " + statoutbooknumber +"&nbsp; </p>");}
        else if(request.getParameter("statprize")!=null){
          out.println("<p>statprize = " + statprizenumber +"&nbsp; </p>");}
          else if(request.getParameter("aveprize")!=null){
            out.println("<p>aveprize = " + aveprizenumber +"&nbsp; </p>");}
          }catch (Exception ex){
          response.sendRedirect("fail.jsp");
ex.printStackTrace();}*/
%>
</center>
</body>
</html>

⌨️ 快捷键说明

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