无法在JSP中获取用户详细信息

时间:2017-09-10 13:40:05

标签: html mysql jsp

我正在根据电子邮件ID获取详细信息,因为我编写了以下代码

<%
        String patientId=request.getParameter("patientId");
        PreparedStatement pst = con.prepareStatement("select email,patientname,patientid from patient where patientId='"+patientId+"'");
        ResultSet rst= pst.executeQuery();
        String email=null;
        %>
       <%while(rst.next()){
           email = rst.getString(1);
       }%>


        <% PreparedStatement ps = conn.prepareStatement("select weight, height, bp, sugarb4,sugaraftr,eyelow,eyehigh,chol,time from measurements where email='"+email+"'" );
         ResultSet rss=ps.executeQuery();
         %>
         <%while(rss.next()){%>
         <table>
                                            <tr><td>Weight</td><td><input type="text" value="<%=rss.getString(1)%>" disabled/></td>
                                            <td>Height</td><td><input type="text" value="<%=rss.getString(2)%>" disabled/></td></tr>
                                            <tr><td>Blood Pressure</td><td><input type="text" value="<%=rss.getString(3)%>" disabled/></td></tr>
                                            <tr><td>Sugar Level Before Fasting</td><td><input type="text" value="<%=rss.getString(4)%>" disabled/></td>
                                            <td>Sugar Level After Fasting</td><td><input type="text" value="<%=rss.getString(5)%>" disabled/></td></tr>
                                            <tr><td>Eye Power Low Vision</td><td><input type="text" value="<%=rss.getString(6)%>" disabled/></td>
                                            <td>Eye Power High Vision</td><td><input type="text" value="<%=rss.getString(7)%>" disabled/></td></tr>
                                            <tr><td>Cholesterol</td><td><input type="text" value="<%=rss.getString(8)%>" disabled/></td></tr>
                                            <tr><td>Date Absorbed</td><td><input type="text" value="<%=rss.getString(9)%>" disabled/></td></tr>
         <%}%>                               
         </table>

但它没有提取任何基于电子邮件的细节。代码中有什么问题请告诉我

0 个答案:

没有答案