这是一个图书馆系统
源代码在线查看: userrights.jsp~4~
User Rights
.style5 {font-size: 36px}
-->
try{
String returnmoney="yes";
String id=Library.getid();
Connection conn=Library.getConn();
Statement stmt;
stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("select * from user where id ='" + id + "'");
while(rs.next()){
Library.setuserrights1("You can borrow " + rs.getString("maxbook") +" in total. ");}
ResultSet rs3 = stmt.executeQuery("select * from borrowbook where id ='" + id + "'");
while(rs3.next()){
returnmoney=rs3.getString("returnmoney");
if(returnmoney.equals("no")){
Library.setuserrights2("But you can't borrow now,because you haven't pay the fee." );
}
}
}catch (Exception ex) {
response.sendRedirect("fail.jsp");
ex.printStackTrace();}%>
UserRights
ModifyMessage
BookSearch
BookReturn
HaveBorrow