<%@ page contentType="text/html;charset=GB2312" %>
<%@ page import="java.sql.*" %>
<HTML>
<BODY bgcolor=pink ><Font size=4>
<% //获取提交的书号：
    String number=request.getParameter("shuhao");
    if(number==null){number="";}    
    byte b[]=number.getBytes("ISO-8859-1");
    number=new String(b);
    Connection con=null;
    Statement sql=null;
    ResultSet rs=null;
    try{
		Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
       }
    catch(ClassNotFoundException event){}
    try {
		con=DriverManager.getConnection("jdbc:odbc:aaa","sa","");
       		sql=con.createStatement();
       //删除操作：
       		String deleteAll="DELETE FROM books WHERE 书号"+" = "+"'"+number+"'";
       		sql.executeUpdate(deleteAll);
%>
<P>删除记录后的表：
<%
       		rs=sql.executeQuery("SELECT * FROM books ORDER BY 书号");
       		out.print("<Table Border>");
            	out.print("<TR>");
            	out.print("<TH width=100>"+"书号");
            	out.print("<TH width=100>"+"书名");
            	out.print("<TH width=100>"+"出版社");
            	out.print("<TH width=100>"+"作者");
            	out.print("<TH width=100>"+"出版日期");
            	out.print("</TR>");
       		while(rs.next())
           	{    
			out.print("<TR>");
                	String n=rs.getString(1);
                 	out.print("<TD >"+n+"</TD>"); 
                	String shuming=rs.getString(2);
                 	out.print("<TD >"+shuming+"</TD>");
                	String chubanshe=rs.getString(3);
                 	out.print("<TD >"+chubanshe+"</TD>");
                	String zuozhe=rs.getString(4);
                 	out.print("<TD >"+zuozhe+"</TD>");
                	String riqi=rs.getString(5);
                 	out.print("<TD >"+riqi+"</TD>");
            		out.print("</TR>") ;  
         	}
       		out.print("</Table>");
      		con.close();
     	}
    	catch(SQLException event)
          {out.print(""+event);
          }
 %>
</FONT>
</BODY>
</HTML>
