<%@ page contentType="text/html;charset=GB2312" %>
<%@ page import="java.sql.*" %>
<HTML>
<BODY>
<% //获取提交的姓名：
    String name=request.getParameter("name3");
          if(name==null)
            {name="";
            }
     byte b[]=name.getBytes("ISO-8859-1");
     name=new String(b);
     Connection con=null;
     Statement sql=null;
     ResultSet rs=null;
     try{Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          }
     catch(ClassNotFoundException e){}
     try { 
		con=DriverManager.getConnection("jdbc:odbc:aaa","sa","");
             	sql=con.createStatement();
             	String condition="SELECT * FROM books WHERE 作者 = "+"'"+name+"'";
             	rs=sql.executeQuery(condition);
         	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>");
                     out.print("<TD >"+rs.getString(1)+"</TD>"); 
                     out.print("<TD >"+rs.getString(2)+"</TD>");
                     out.print("<TD >"+rs.getString(3)+"</TD>");
                     out.print("<TD >"+rs.getString(4)+"</TD>");
                     out.print("<TD >"+rs.getString(5)+"</TD>");
                     out.print("</TR>") ;  
                    }
              out.print("</Table>");
              con.close();
           }
    	catch(SQLException e)
           {  }
%>
</BODY>
</HTML>
