Ankit Kumar
jsp-datagrid
1 Answer(s)      11 months ago
Posted in : Java Beginners

hello sir...i have one view page in which edit and delete option are there in a datagrid view and i want to show data in page wise(pagination)...with previous and next links....i am also attaching my code for your convience....plz look to it its very urgent....plz...??????

<body>
    <form method="post" name="form">

<table border="1"><a href=""></a>
        <table >
        <tr bgcolor="#E8E8E8">
        <td><b>ID</b></td>
        <td><b>Name</b></td>
        <td><b>Age</b></td>
        <td><b>Gender</b></td>
        <td><b>Address</b></td>
        <td><b>Phone</b></td>
        <td><b>Post</b></td>
        <td colspan="2"><b>Action</b></td>
        </tr>
        <%!                    ResultSet rs = null;

        %>
        <%

            try {
            Class.forName("com.mysql.jdbc.Driver").newInstance();
            Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/sms", "root", "root");
            String query = "select * from post";
            Statement st;
            st = con.createStatement();
            ResultSet rs = st.executeQuery(query);
        %>
        <%
            while (rs.next()) {
        %>
        <tr bgcolor="#D8D8D8" >
            <td width='50'><%=rs.getString(1)%></td>
            <td width='50'><%=rs.getString(2)%></td>
            <td width='50'><%=rs.getString(3)%></td>
            <td width='50'><%=rs.getString(4)%></td>
            <td width='50'><%=rs.getString(5)%></td>
            <td width='50'><%=rs.getString(6)%></td>
            <td width='50'><%=rs.getString(7)%></td>




<td><input type="submit"  value="Edit" style="background-color:green;font-weight:bold;color:white;" onclick="editRecord(<%=rs.getString(1)%>)" ></a></td>
<td><input type="submit"  value="Delete" style="background-color:red;font-weight:bold;color:white;" onclick="deleteRecord(<%=rs.getString(1)%>)" ></a></td>
</tr>
<%
}
%>
<%
}
catch(Exception e){
e.printStackTrace();
}
%>



</table>
</form>
View Answers

June 11, 2012 at 4:21 PM


Have a look at the following link:

Visit Here









Related Pages:
jsp-datagrid
jsp-datagrid  hello sir...i have one view page in which edit and delete option are there in a datagrid view and i want to show data in page wise(pagination)...with previous and next links....i am also attaching my code for your
jsp-datagrid
jsp-datagrid  hello sir...i have one view page in which edit and delete option are there in a datagrid view and i want to show data in page wise(pagination)...with previous and next links....i am also attaching my code for your
jsp-datagrid
jsp-datagrid  hello sir...i have one view page in which edit and delete option are there in a datagrid view and i want to show data in page wise(pagination)...with previous and next links....i am also attaching my code for your
jsp-datagrid
jsp-datagrid  hello sir.....i have 20 records in my database and i am showing those data in datagrid view but now i want to show 10 data in one page... option in my datagrid view with 1,2 pages....plz help me...awaiting for your
jsp-datagrid
jsp-datagrid  hello sir.....i have 20 records in my database and i am showing those data in datagrid view but now i want to show 10 data in one page... option in my datagrid view with 1,2 pages....plz help me...awaiting for your

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.