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

📄 find_book.jsp

📁 此为图书管理系统
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!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/css">
<!--
BODY {
	BACKGROUND-IMAGE: none; BACKGROUND-COLOR: #ade3ff
}
.STYLE5 {color: #FFFFFF; font-weight: bold; }
.STYLE6 {	font-family: "楷体_GB2312";
	color: #FF0000;
}
-->
</style>
<jsp:useBean id="ConnBean" scope="page" class="com.bean.db.conn" />
</head>
<body>
<h1 align="center"><span class="STYLE6">图书管理</span></h1>
<form id="form1" name="form1" method="post" action="?act=find">
  <label>
  <select name="titl" id="titl">
    <option value="bname">书名</option>
    <option value="bid">图书编号</option>
	<option value="bcbs">出版社</option>
	<option value="bzz">作者</option>
  </select>
  <input name="strText" type="text" id="strText" />
  <input type="submit" name="Submit" value="确定" />
  </label>
</form>
<br />
<br />
<table width="96%" border="1" cellpadding="0" cellspacing="0" bordercolor="#999999">
  <tr align="center">
    <td width="9%" bgcolor="#000099"><span class="STYLE5">图书编号</span></td>
    <td width="23%" bgcolor="#000099"><span class="STYLE5">书名</span></td>
    <td width="23%" bgcolor="#000099"><span class="STYLE5">出版社</span></td>
    <td width="13%" bgcolor="#000099"><span class="STYLE5">作者</span></td>
    <td width="11%" bgcolor="#000099"><span class="STYLE5">定价</span></td>
    <td width="9%" bgcolor="#000099"><span class="STYLE5">剩余数量</span></td>
  </tr>
  <%
  try{
  String sql="";
  String Titl=request.getParameter("titl");
  String strText=request.getParameter("strText");
  String str=request.getParameter("act");
  if (str.equals("find"))
  {
  if (strText!=null && Titl!=""){
  sql="select * from book where "+Titl+" like'%"+strText+"%'";
  }else{
  sql="select * from book";  
  }
  for(ResultSet rs = ConnBean.executeQuery(sql);rs.next();){
  	String ids=rs.getString("bid");
  %>
  <tr>
    <td>&nbsp;<%=ids%></td>
    <td>&nbsp;<%=rs.getString("bname")%></td>
    <td>&nbsp;<%=rs.getString("bcbs")%></td>
    <td>&nbsp;<%=rs.getString("bzz")%></td>
    <td>&nbsp;<%=rs.getString("bdj")%></td>
    <td>&nbsp;<%=rs.getInt("bsl")-rs.getInt("iosl")%></td>
  </tr>
  <%
  }}}
  catch(Exception e){}
%>
</table>
</body>
</html>

⌨️ 快捷键说明

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