Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <title>Untitled Document</title>
- </head>
- <body>
- <form id="form1" name="form1" method="post" action="">
- <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
- <tr bgcolor="#66FF99">
- <td>Sr.</td>
- <td>Name</td>
- <td>Cost</td>
- </tr>
- <%
- int p= Integer.parseInt(request.getParameter("textfield"));
- Class.forName("com.mysql.jdbc.Driver");
- Connection con=DriverManager.getConnection("jdbc:mysql://localhost/tiop","root","root");
- Statement stat=con.createStatement();
- 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
- and (p*5)");
- while(rs.next())
- {
- %>
- <tr>
- <td bgcolor="#99CC33"><%=rs.getInt(1)%></td>
- <td bgcolor="#669966"><%=rs.getString(2)%></td>
- <td bgcolor="#FF3333"><%=rs.getInt(3)%></td>
- </tr>
- <%
- }
- %>
- </table>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement