tushuleibieJSP.jsp
上传用户:cnkaiguan
上传日期:2014-08-25
资源大小:5403k
文件大小:2k
- <%@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>");
- Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
- Connection con=DriverManager.getConnection("jdbc:odbc:booksystem");
- Statement sql=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
-
-
- ResultSet rs=sql.executeQuery("select * from books where categoryname='JSP'");
-
- 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>");
- }
-
-
-
-
- con.close();
- %>