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

📄 student_infor.jsp

📁 基于jsp的图书管理系统的功能和实现
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="data.LoginData"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/html">
<!--
.STYLE1 {font-size: 9px}
-->
</style>
<style type="text/css">
<!--
.STYLE9 {font-size: 24px; font-weight: bold; color: #3399FF; }
.STYLE12 {font-size: 16px; font-weight: bold; color: #000000; }
.STYLE13 {font-size: 16px; color: #FFFFFF; }
.STYLE14 {
	font-size: 14px;
	font-weight: bold;
	color: #FFFFFF;
}
-->
</style>
</head>

<body>
<jsp:useBean id="show" class="Bean.MachSearch" scope="page">
</jsp:useBean>
<jsp:useBean id="connDbBean" scope="page" class="db.dbConn"/>
<%
 Connection conn=null;
 Statement stmt=null;
 ResultSet rs=null;
 String strSql="";
 int PageSize=15;
 int Page=1;
 int totalPage=1;
 int totalrecord=0;
 int totalrecord1=0;
%>

<table width="975" border="0" cellpadding="0" cellspacing="0" bordercolor="#333399">
  <!--DWLayoutTable-->
  <tr>
    <td height="76" colspan="3" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="171" rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="171" height="76" valign="middle"><img src="image/tushu2.bmp" /></td>
          </tr>
        </table>        </td>
        <td width="75" height="28">&nbsp;</td>
        <td width="100">&nbsp;</td>
        <td width="18">&nbsp;</td>
        <td width="101">&nbsp;</td>
        <td width="26">&nbsp;</td>
        <td width="100">&nbsp;</td>
        <td width="30">&nbsp;</td>
        <td width="100">&nbsp;</td>
        <td width="49">&nbsp;</td>
        <td width="100">&nbsp;</td>
        <td width="105">&nbsp;</td>
      </tr>
      <tr>
        <td height="48">&nbsp;</td>
        <td valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="100" height="48" align="center" valign="bottom" bgcolor="#F5F5F5"><a href="newBk_Insert.jsp" class="STYLE12">新书入库</a></td>
              </tr>
        </table></td>
        <td>&nbsp;</td>
        <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="100" height="48" align="center" valign="bottom" bgcolor="#F5F5F5"><a href="bk_Borrow.jsp" class="STYLE12">图书借出</a></td>
              </tr>
        </table></td>
        <td>&nbsp;</td>
        <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="100" height="48" align="center" valign="bottom" bgcolor="#F5F5F5"><a href="bk_Retrun.jsp" class="STYLE12">还书系统</a></td>
              </tr>
        </table></td>
        <td>&nbsp;</td>
        <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="109" height="48" align="center" valign="bottom" bgcolor="#3366CC" class="STYLE9"><a href="student_Infor.jsp" class="STYLE13">学生信息</a></td>
              </tr>
        </table></td>
        <td>&nbsp;</td>
        <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="149" height="48" align="center" valign="bottom" bgcolor="#F5F5F5"><a href="admin_Infor.jsp" class="STYLE12">管理员信息</a></td>
              </tr>
        </table></td>
        <td>&nbsp;</td>
      </tr>
      
      
      
    </table></td>
  </tr>
  <tr>
    <td height="30" colspan="3" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="975" height="30" bgcolor="#3366CC">&nbsp;</td>
      </tr>
    </table>    </td>
  </tr>
  <tr>
    <td width="172" height="14">&nbsp;	</td>
    <td width="729">&nbsp;</td>
    <td width="74">&nbsp;</td>
  </tr>
  <tr>
    <td height="262">&nbsp;</td>
    <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="138" height="25" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bordercolor="2">
          <!--DWLayoutTable-->
          <tr>
            <td width="138" height="25" align="left" valign="bottom" bgcolor="#3366CC"><span class="STYLE14">学生信息</span></td>
          </tr>
        </table>        </td>
        <td width="591">&nbsp;</td>
      </tr>
      <tr>
        <td height="237" colspan="2" valign="top"><table width="100%" border="2" cellpadding="0" cellspacing="0" bordercolor="#3366CC">
          <!--DWLayoutTable-->
          <tr bordercolor="#3366CC">
            <td width="729" height="237" align="center" valign="middle"><%
		  
	try{
	    
		 LoginData loginData = new LoginData(); 
	     conn = loginData.getConn();
		 stmt=conn.createStatement(
		 ResultSet.TYPE_SCROLL_INSENSITIVE,
		 ResultSet.CONCUR_READ_ONLY);
		 strSql = "SELECT count(*) as recordcount FROM Reader";
		 rs = stmt.executeQuery(strSql);
		 if (rs.next()) totalrecord = rs.getInt("recordcount");
	     strSql= "SELECT * FROM Reader";
	     rs = stmt.executeQuery(strSql);
	      if(totalrecord%PageSize==0)totalPage=totalrecord/PageSize;
	      else totalPage=(int)Math.floor(totalrecord/PageSize)+1;
		  
	       if(totalPage==0)totalPage=1;
	        if(request.getParameter("Page")==null||request.getParameter("Page").equals(""))
	          Page=1;
	          else{
 	             try{
	                   Page=Integer.parseInt(request.getParameter("Page"));
	                }catch(java.lang.NumberFormatException e){
	                  Page=1;
	                 }
	                
	              }   
	             if(Page<1)Page=1;
	             if(Page>totalPage)Page=totalPage;
	               rs.absolute((Page-1)*PageSize+1);
	               out.print("<table border='1' width='700' border='300' cellpadding='0' cellspacing='0' bordercolor='#3366CC'>");
	               out.print("<tr bgcolor='#6699CC'><td><font color=''><b>"+"读者编号"+"</b></font></td>");
                   out.print("<td><font color=''><b>"+"读者姓名"+"</b></font></td>");
                   out.print("<td><font color=''><b>"+"读者性别"+"</b></font></td>");
                   out.print("<td><font color=''><b>"+"出生日期"+"</b></font></td>");
				   out.print("<td><font color=''><b>"+"读者类别"+"</b></font></td>");
                   out.print("<td><font color=''><b>"+"借书上限"+"</b></font></td>");
                   out.print("<td><font color=''><b>"+"已借数目"+"</b></font></td></tr>");
              
                   
                      for(int iPage=1;iPage<=PageSize;iPage++)   {
                       out.print("<TD><A HREF='ShowStudent.jsp?id="+rs.getString("Rnumber")+"'>"+rs.getString("Rnumber")+"</A></TD>");
                       out.print("<td>"+rs.getString("Rname")+"</td>"); 
					   out.print("<td>"+rs.getString("Rsex")+"</td>");
                       out.print("<td>"+rs.getString("Rbirth")+"</td>"); 
					   out.print("<td>"+rs.getString("Rsort")+"</td>"); 
					   out.print("<td>"+rs.getInt("Rlimited")+"</td>");
                       out.print("<td>"+rs.getInt("Ryamount")+"</td></tr>");
                     
                      
                 
                        if(!rs.next()) break;
                       }
                    out.print("</table>");  
		}
		catch(SQLException e){
	    System.out.println(e.getMessage());
		}
	    finally{
		stmt.close();
		conn.close();
			}
		   %>
              &nbsp;
			
			  <form action="student_Infor.jsp" method="get">
                     <p><span class="STYLE2"><strong>
                       <%
                     if(Page!=1){
                       out.print("  <a href=student_Infor.jsp?Page=1>第一页</a>");
                       out.print("  <a href=student_Infor.jsp?Page="+(Page-1)+"></a> ");
                     }
                     if(Page!=totalPage){
                        out.print(" <a href=student_Infor.jsp?Page="+(Page+1)+"></a>");
                        out.print(" <a hreg=student_Infor.jsp?Page="+totalPage+"></a>");
                     }
                     %>
                     <br>
                       </strong></span><strong>输入页书</strong><span class="STYLE2"><strong>:
                       <input type="text" name="Page" size="5">
                       </strong></span><strong>页数</strong><span class="STYLE2"><strong>:<font color="red"><%=Page%>/<%=totalPage%></font>
                    
                         </strong></span></p>
          </form>
			</td>
          </tr>
        </table>
        </td>
        </tr>
    </table>
    </td>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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