Guest User

Untitled

a guest
Dec 20th, 2018
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  2. pageEncoding="ISO-8859-1"%>
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <meta charset="ISO-8859-1">
  7. <title>Insert title here</title>
  8. </head>
  9. <body>
  10.  
  11.  
  12. <%@page import="java.sql.*" %>
  13.  
  14. <%@page import="java.io.*" %>
  15.  
  16. <%@page import="java.sql.Connection" %>
  17.  
  18. <%
  19.  
  20.  
  21.  
  22. Class.forName("com.mysql.jdbc.Driver");
  23.  
  24. Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/aurora","root","");
  25.  
  26. Statement st=con.createStatement();
  27.  
  28. String query="select * from kongu";
  29.  
  30. ResultSet rs=st.executeQuery(query);
  31.  
  32. %>
  33.  
  34. <%
  35. while(rs.next())
  36.  
  37. {
  38. %>
  39. <table >
  40.  
  41. <tr>
  42.  
  43. <th> Name</th>
  44.  
  45. <th>Age</th>
  46.  
  47. <th>Mobile Number</th>
  48.  
  49. <th>Msg</th>
  50.  
  51. <th>Lat</th>
  52.  
  53.  
  54.  
  55. </tr>
  56.  
  57. <tr>
  58.  
  59. <td><%=rs.getString(1)%></td>
  60.  
  61. <td><%=rs.getString(2)%></td>
  62.  
  63. <td><%=rs.getString(3)%></td>
  64.  
  65. <td><%=rs.getString(4)%></td>
  66.  
  67. <td><%=rs.getString(5)%></td>
  68.  
  69.  
  70.  
  71.  
  72.  
  73. </tr>
  74.  
  75. </table>
  76. <%
  77.  
  78. }
  79. %>
  80.  
  81.  
  82.  
  83. </body>
  84. </html>
Add Comment
Please, Sign In to add comment