这是一个图书馆管理系统的jsp代码
源代码在线查看: search.jsp~7~
Search
.style3 {font-size: 24px}
.style4 {font-size: 18px}
-->
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("statbook = " + statbooknumber +" ");}
else if(request.getParameter("statinbook")!=null){
out.println("statinbook = " + statinbooknumber +" ");}
else if(request.getParameter("statoutbook")!=null){
out.println("statoutbook = " + statoutbooknumber +" ");}
else if(request.getParameter("statprize")!=null){
out.println("statprize = " + statprizenumber +" ");}
else if(request.getParameter("aveprize")!=null){
out.println("aveprize = " + aveprizenumber +" ");}*/
}catch (Exception ex){
response.sendRedirect("fail.jsp");
ex.printStackTrace();}
%>
Adduser
Modifyuser
Deletuser
Searchuser
Addbook
Deletebook
Borrowsearch
Search
Userpay
Update
Search
StatBook:
StateInBook:
StateOutBook:
StatPrize:
AvePrize: