📄 ziduan_result.jsp
字号:
<%@page contentType="text/html;charset=gbk" %>
<%@page import="java.sql.*" %>
<%
out.print("<table border>");
out.print("<tr>");
out.print("<th width=72>图书编号</td>");
out.print("<th width=72>图书类别</td>");
out.print("<th width=68>图书名称</td>");
out.print("<th width=62>作者</td>");
out.print("<th width=70>供应商</td>");
out.print("<th width=84>出版日期</td>");
out.print("<th width=54>售价</td>");
out.print("<th width=65>库存量</td>");
out.print("<th width=50>是否发布</td>");
out.print("<th width=50>是否热点书</td>");
out.print("<th width=52>销售量</td>");
out.print("<tr>");
String sidbook=request.getParameter("idbook");
String idbook=new String(sidbook.getBytes("iso-8859-1"));
String scategoryname=request.getParameter("selectcategoryname");
String categoryname=new String(scategoryname.getBytes("iso-8859-1"));
String sbookname=request.getParameter("bookname");
String bookname=new String(sbookname.getBytes("iso-8859-1"));
String sauthor=request.getParameter("author");
String author=new String(sauthor.getBytes("iso-8859-1"));
String ssuppliername=request.getParameter("suppliername");
String suppliername=new String(ssuppliername.getBytes("iso-8859-1"));
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:booksystem");
Statement sql=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
ResultSet rs=sql.executeQuery("select * from books where idbook='"+idbook+"' and categoryname='"+categoryname+"' or bookname='"+bookname+"' or author='"+author+"' or suppliername='"+suppliername+"'");
while(rs.next())
{
String a,b,c,d,e,f,g,h,i,j,k;
a=rs.getString(1);
out.print("<td>"+a+"</td>");
b=rs.getString(2);
out.print("<td>"+b+"</td>");
c=rs.getString(3);
out.print("<td>"+c+"</td>");
d=rs.getString(4);
out.print("<td>"+d+"</td>");
e=rs.getString(5);
out.print("<td>"+e+"</td>");
f=rs.getString(6);
out.print("<td>"+f+"</td>");
g=rs.getString(7);
out.print("<td>"+g+"</td>");
h=rs.getString(8);
out.print("<td>"+h+"</td>");
i=rs.getString(9);
out.print("<td>"+i+"</td>");
j=rs.getString(10);
out.print("<td>"+j+"</td>");
k=rs.getString(11);
out.print("<td>"+k+"</td>");
out.print("<tr>");
}
//else
//out.print("暂无此书!");
con.close();
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -