日期:2014-05-18  浏览次数:20714 次

如何使查询数据的数据更快些
下面是我从数据里查询出来的数据,现在查询的数据很慢,大家帮我看看如何优化
<HTML>
<HEAD>
<%@   page   language= "java "   contentType= "text/html;   charset=UTF-8 "
pageEncoding= "UTF-8 "%>
<%@page   import= "com.gsi.scm.db.DBscm "   %>
<%@page   import= "com.gsi.scm.utils.HandlePage "   %>
<%@page   import= "java.sql.ResultSet "   %>
<META   http-equiv= "Content-Type "   content= "text/html;   charset=UTF-8 ">
<META   name= "GENERATOR "   content= "IBM   Software   Development   Platform ">
<META   http-equiv= "Content-Style-Type "   content= "text/css ">
<TITLE> OA系统 </TITLE>
</HEAD>
<%
    DBscm   db   =   new   DBscm();//连接数据库
    HandlePage   handlePage   =   new   HandlePage();
    int   size   =   12;
    int   pageCount   =   0;
    String   sql=   "select   a.C_Usr_Id,a.C_Usr_Name,a.C_Usr_Passwd,a.C_Sex,a.C_Degree_Id,a.D_Birthday,a.C_Education,a.C_Usr_Comment   from   sys_usr   a,sys_role_usr   b,sys_roles   c   where   a.C_Usr_ID=b.C_Usr_ID   and   c.C_Roles_ID=b.C_Role_ID   and   b.C_Role_ID= '1 ' ";
            ResultSet   rs   =   db.getSelectRs(sql);
    rs.last();
    int   recordCount   =   rs.getRow();
    handlePage.calcuePage(recordCount,size);
    pageCount   =   handlePage.getPageCount();
    rs.beforeFirst();
%>
<body>
<table   width= "741 "   border= "0 "   cellspacing= "0 "   cellpadding= "0 ">
    <tr>
        <td   height= "38 "   > <table   width= "709 "   border= "0 "   cellspacing= "0 "   cellpadding= "0 ">
        </table> </td>
    </tr>
    <tr>
        <td   height= "34 "   bgcolor= "#CCE0F5 "> <table   width= "727 "   border= "0 "   cellspacing= "0 "   cellpadding= "0 ">
            <tr>
                <td   width= "140 "> 您当前的身份是:管理员&nbsp; </td>
            </tr>
        </table> </td>
    </tr>
    <tr>
        <td   width= "741 "   bgcolor= "#CCCCCC "> <table   width= "741 "   border= "0 "   align= "left "   cellpadding= "0 "   cellspacing= "1 ">
            <tr   bgcolor= "C8E2FB ">
                <td   width= "77 "   height= "29 "   bgcolor= "#F2F4F6 "> <div   align= "center