Advertisement
Guest User

Untitled

a guest
Jun 30th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  6. <title>Untitled Document</title>
  7. </head>
  8.  
  9. <body>
  10. <form id="form1" name="form1" method="post" action="">
  11. <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
  12. <tr bgcolor="#66FF99">
  13. <td>Sr.</td>
  14. <td>Name</td>
  15. <td>Cost</td>
  16.  
  17. </tr>
  18.  
  19.  
  20.  
  21.  
  22. <%
  23.  
  24.  
  25. int p= Integer.parseInt(request.getParameter("textfield"));
  26. Class.forName("com.mysql.jdbc.Driver");
  27. Connection con=DriverManager.getConnection("jdbc:mysql://localhost/tiop","root","root");
  28. Statement stat=con.createStatement();
  29. ResultSet rs=stat.executeQuery("select * From (select * , Row_Number() over (order by Sr) as RowNum From cre )T where T.RowNum between ((p-1)*5)+1
  30. and (p*5)");
  31.  
  32. while(rs.next())
  33. {
  34.  
  35.  
  36.  
  37. %>
  38. <tr>
  39. <td bgcolor="#99CC33"><%=rs.getInt(1)%></td>
  40. <td bgcolor="#669966"><%=rs.getString(2)%></td>
  41. <td bgcolor="#FF3333"><%=rs.getInt(3)%></td>
  42.  
  43. </tr>
  44.  
  45. <%
  46. }
  47.  
  48. %>
  49. </table>
  50. </form>
  51. </body>
  52. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement