?? tushuxiugai_result.jsp
字號:
<%@page contentType="text/html;charset=gbk" %>
<%@page import="java.sql.*" %>
<%
String sidbook=request.getParameter("idbook");
String idbook=new String(sidbook.getBytes("iso-8859-1"));
String scategoryname=request.getParameter("categoryname");
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"));
String soutday=request.getParameter("outday");
String outday=new String(soutday.getBytes("iso-8859-1"));
String sprice=request.getParameter("price");
String price=new String(sprice.getBytes("iso-8859-1"));
String sstock=request.getParameter("stock");
String stock=new String(sstock.getBytes("iso-8859-1"));
String sfabu=request.getParameter("selectfabu");
String fabu=new String(sfabu.getBytes("iso-8859-1"));
String shotdeal=request.getParameter("selecthotdeal");
String hotdeal=new String(shotdeal.getBytes("iso-8859-1"));
String ssale=request.getParameter("sale");
String sale=new String(ssale.getBytes("iso-8859-1"));
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:booksystem");
Statement sql=con.createStatement();
ResultSet rs=sql.executeQuery("select * from books where idbook='"+idbook+"'");
if(rs.next())
{
sql.executeUpdate("update books set categoryname='"+categoryname+"' where idbook='"+idbook+"'");
sql.executeUpdate("update books set bookname='"+bookname+"' where idbook='"+idbook+"'");
sql.executeUpdate("update books set author='"+author+"' where idbook='"+idbook+"'");
sql.executeUpdate("update books set suppliername='"+suppliername+"' where idbook='"+idbook+"'");
sql.executeUpdate("update books set outday='"+outday+"' where idbook='"+idbook+"'");
sql.executeUpdate("update books set price='"+price+"' where idbook='"+idbook+"'");
sql.executeUpdate("update books set stock='"+stock+"' where idbook='"+idbook+"'");
sql.executeUpdate("update books set fabu='"+fabu+"' where idbook='"+idbook+"'");
sql.executeUpdate("update books set hotdeal='"+hotdeal+"' where idbook='"+idbook+"'");
sql.executeUpdate("update books set sale='"+sale+"' where idbook='"+idbook+"'");
}
else
out.print("<strong>暫無此書(圖書編號:'"+idbook+"')!</strong>"+"<p>");
rs=sql.executeQuery("select * from books ");
out.print("數據庫中的書目如下: ");
out.print("<table border>");
out.print("<tr>");
out.print("<th width=72>圖書編號</td>");
out.print("<th width=72>圖書類別</td>");
out.print("<th width=50>圖書名稱</td>");
out.print("<th width=50>作者</td>");
out.print("<th width=62>出 版 商</td>");
out.print("<th width=50>出版日期</td>");
out.print("<th width=50>售價</td>");
out.print("<th width=50>庫存(本)</td>");
out.print("<th width=50>是否發布</td>");
out.print("<th width=50>是否熱點書</td>");
out.print("<th width=50>出售(本)</td>");
out.print("</tr>");
while(rs.next())
{
String a,b,c,d,e,f,g,h,i,j,k;
out.print("<tr>");
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>");
}
con.close();
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -