<%@ page import ="java.sql.*" %> <%@ page import ="javax.sql.*" %> <%@page contentType="text/html" pageEncoding="UTF-8"%>
<title>Login User</title>
<%! Connection con;ResultSet rs;Statement st; String pid;%> <%
try { Class.forName("com.mysql.jdbc.Driver").newInstance(); con = DriverManager.getConnection("jdbc:mysql://localhost:3306/health_care", "root", "123");
st = con.createStatement();
pid=request.getParameter("pid"); System.out.println(pid); rs=st.executeQuery("select * from patient where userid='"+"pid"+"'");
Boolean t=rs.next(); System.out.println(t); System.out.println("hai"); System.out.println(request.getParameter("pid"));
System.out.println(rs.getString(3)); // System.out.println(rs.getString(4)); // System.out.println(rs.getString(5)); if(!t){ System.out.println("No result"); } else { do{ %>
<table> <tr>PATIENT DETAILS</tr><br> <tr><br> <td>Patient Name</td> <td><input type="text" name="pname" value="<%=rs.getString(3)%>"></td> </tr> <td>DOB</td> <td><input type="text" name="pname" value="<%=rs.getString(4)%>"></td> </tr> <tr> <td>Sex</td> <td><input type="text" name=value="<%=rs.getString(5)%>"></td> </tr> <tr> <td>Address</td> <td><input type="text" name="ads" value="<%=rs.getString(6)%>"></td> </tr> <tr> <td>State</td> <td><input type="text" name="stt" value="<%=rs.getString(7)%>"></td> </tr> <tr> <td>Pincode</td> <td><input type="text" name="pn" value="<%=rs.getString(8)%>"></td> </tr> <tr> <td>Mobile</td> <td><input type="text" name="mob" value="<%=rs.getString(9)%>"></td> </tr></td> </tr> <tr> <td>Landline</td> <td><input type="text" name="lnd" value="<%=rs.getString(10)%>" ></td> </tr> </table>
<% }while(rs.next()); }
}
catch(Exception e){} %>
Ads