使用servlet通过ID从数据库中删除行 [英] Delete a row from database by id using servlet

查看:87
本文介绍了使用servlet通过ID从数据库中删除行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用servlet创建一个小型应用程序.有一个表单(index.jsp)在提交表单时具有10个字段,所有值都添加到数据库中,并且页面被重定向到包含Submitted表单条目的新页面.现在,有2个额外的列(10 + 2)用于删除"和更新".在单击delete(是超链接)时,应删除特定行,并在单击update时,我们应该能够更新其值.因此,任何人都会告诉我如何给超级链接提供Delete和Update以及删除查询(按ID).???

I m creating a small application using servlet. There is a form (index.jsp)having 10 fields on submitting the form all the values are added in to database and page is redirected to a new page that contains entries of submittes form. Now there are 2 extra columns(10+2) for "DELETE" AND "UPDATE". On clicking delete which is hyper link that particular row should be deleted and on clicking update , we should be able to update its value. So anyone will tell me how to give hyper link to Delete and Update and delete query (by id).???

推荐答案

数据库?
很好,然后找出要删除并触发的所需数据集!
如果您在那儿有身份证,那是什么样的?它是特定于数据集的还是仅仅是表中的索引?

MySQL-删除语法 [ MySQL-更新语法 [
So you already have a connection to the database?
Fine, then just figure out the desired dataset to delete and fire!
What kind if ID have you there? is it specific to the dataset or is that just the index from the table?

MySQL - DELETE Syntax[^]

MySQL - UPDATE Syntax[^]


这篇关于使用servlet通过ID从数据库中删除行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆