•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 397,625 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,430 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 1459 | Replies: 3 | Solved
•
•
Join Date: May 2008
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 1
hi,
i am new to jsp..i am trying do sort out a pblm..
i have 2 jsp files..
file1.jsp..
which is used to select all the records from a table called staff and display the records in a table..each record is coming with a check boxes which is used for marking..
i need to select all the records i want to delete and by pressing a submit button i want to delte all the records frm the table..
how is it possible..i wrote the code for the first part..it is like..
page1.jsp
how to do the second part...any one to help me plzzzz....
i am new to jsp..i am trying do sort out a pblm..
i have 2 jsp files..
file1.jsp..
which is used to select all the records from a table called staff and display the records in a table..each record is coming with a check boxes which is used for marking..
i need to select all the records i want to delete and by pressing a submit button i want to delte all the records frm the table..
how is it possible..i wrote the code for the first part..it is like..
page1.jsp
JSP Syntax (Toggle Plain Text)
<html> <body> <table width="50%" border="1" rules=ALL> <tr><th> Username</th><th>Access Level</th><th>Delete</th></tr> <%@ page language="java" import="java.sql.*" %> <% int j=0; Connection con =null; Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:udsn","",""); Statement st=con.createStatement(); ResultSet rs=st.executeQuery("select * from staff"); while (rs.next()) { j=j+1;%> <tr><td align="center"><%=rs.getString(1)%></td><td align="center"><%=rs.getString(3)%></td><td><input type="checkbox" name="delete" value="yes"></tr> <%} %> <form action="deleteuser.jsp"> <input type="hidden" name="recordcount" value="<%=j%>"> <input type="submit" name="b1" value="Delete" > </table> </form> </body> </html>
how to do the second part...any one to help me plzzzz....
Last edited by peter_budo : May 9th, 2008 at 7:27 am. Reason: Keep It Organized - please use [code] tags
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JSP Marketplace
Other Threads in the JSP Forum
- Previous Thread: Stopping a very time consuming class method's execution on tomcat server using JSP.
- Next Thread: apache tomcard



Threaded Mode