include a delete option in every row of table in a JSP page
I have the following code of a JSP page...........
<blockquote>
<p><%@taglib prefix="c"
uri="http://java.sun.com/jsp/jstl/core"%> <%@taglib prefix="sql"
uri="http://java.sun.com/jsp/jstl/sql"
%> <sql:setDataSource
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/employee"
user="root" password="shubham"/>
<sql:query var="rs" sql="select* from
login"> </sql:query> <html>
<head>
<title>JSP Page</title>
</head>
<body>
<table border="1">
<tr><td>Username </td><td>Password</td><td>Role</td><td>Edit</td><td>Delete</td></tr>
<c:forEach var="data" items="${rs.rows}">
<tr><td>${data.username}</td><td>${data.pass}</td><td>${data.role}</td><td><a
href="edit.jsp">Edit</a></td><td><a
href="delete.jsp">Delete</a></td></tr>
</c:forEach>
</table>
</body> </html></p>
</blockquote>
Now, I want that on clicking on Delete it should delete the particular record from the database and reflect the change on the page..............also if the user clicks on edit then he can change the password and role but not the username.........
please provide the code for this purpose........i.e edit.jsp and delete.jsp in JSTL only........
View Answers
Ads
Related Tutorials/Questions & Answers:
Advertisements
How to get table row contents into next jsp page
How to get
table row contents into next
jsp page Hi,
I have a 30... page.But the problem is how do i get the selected radio button
table row contents in the next
jsp page and display them
Thanks
Vikas
The given
Table's row elimination based on option choosen
Table's row elimination based on
option choosen I have a drop down with yes and no option.if i select yes in a
table 2 new rows are shown and if i select no another question in
row appears but the space occupied by the question
delete row from a table using hibernate
delete row from a
table using hibernate //code in java file
String hql="
delete from CONTACT c where ID=6";
Query query=session.createQuery... [
delete from CONTACT]
int i=query.executeUpdate
JDBC Delete Row In Table Example
JDBC
Delete Row In
Table Example :
In this tutorial we will learn how
delete specific
row from the
table use mysql
JDBC driver.This tutorial defined how one or more specific
row delete from
table that follow any given condition
delete row
delete row how to
delete row using checkbox and button in php...="
delete" >
<
table width="100%" border="1">
<tr><td>...
if(isset($_POST['
delete']))
{
for($i=0;$i<$
row;$i++)
{
$
delete
The Include Directive in JSP Page
The
Include Directive in
JSP Page
 ...;
<%@
include file="relativeURL" %>
<
jsp:
include page="relativeURL"
/> or <
jsp:
include page="
Delete row and column from table through java code
Delete row and column from
table through java code... will see how to
delete row and
column from given
table through java code. Java code... will
delete the
row having minimum
value of ID then
delete the column named
How To Include Two Jsp page in another jsp page?
How To
Include Two
Jsp page in another
jsp page? I use following code to
Include Two
Jsp Page Header and footer
<%@
include file="header.jsp... the following links:
http://www.roseindia.net/
jsp/
jsp-
include-file.shtml
http
insert , edit , and delete button in one jsp page
insert , edit , and
delete button in one
jsp page hello
I want to ask about the way of creating a
jsp page contains insert , edit , and
delete buttons and manipulate data in database directly.
any help please or hints
Include Static HTML Page in JSP
Include Static HTML
Page in
JSP
 ... html
page in
jsp.
In
JSP, there are two ways to
include another web resource.
1.
include directive and
2.
jsp:
include element.
Using
include directive
Delete a Specific Row from a Database Table
Delete a Specific
Row from a Database
Table
 ... the connection we are going to
delete a specific
row
from the
table. If the
row... in a
row,
now we need to
delete that wrong data. This can be done very easily
using insert and delete in a single page in jsp
using insert and
delete in a single
page in jsp I am using the following code in
jsp to declare two javascript functions to insert and
delete in a single
jsp page but insert function doesn't works only
delete function works even
sqlite database delete row
sqlite database
delete row How to
delete row from SQLite Database?
NSString *updateSQL = [NSString stringWithFormat: @"
DELETE FROM aListDB WHERE id='%@'",details.ids
delete row using id
delete row using id package pkg2;
import org.hibernate.Query;
import... = "
delete from Insurance insurance where id = 2";
Query query = sess.createQuery(hql);
int
row = query.executeUpdate();
if (
row == 0
uitableview manually delete row
uitableview manually
delete row uitableview manually
delete row
NSMutableIndexSet *indexes = [NSMutableIndexSet indexSet];
[array removeObjectAtIndex:indexPath.row];
if(![array count])
[indexes addIndex
Delete a row from database by id
Delete a
row from database by id I m creating a small application...) for "
DELETE" AND "UPDATE".
On clicking
delete which is hyper link that particular
row... all the values are added in to database and
page is redirected to a new
page
JavaScript add row dynamically to table
and into this
page we
have created a
table with one
row. We have one button "Add...
JavaScript add
row dynamically to
table
 ... to add
row to a
table dynamically then we can also do this with
the JavaScript code
How we delete a data of database from front end jsp page
How we
delete a data of database from front end
jsp page I make a website and featch a data from data base and now i want that a
delete button put... deleted from
jsp page as well as from database.I used mysql and
jsp. Please help me