通过Java从SQL表中删除一行 [英] Delete a row from a SQL table via Java

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

问题描述

如何通过接受用户名来通过Java从SQL表中删除行?

How do I delete a row from SQL table through Java by accepting a username from user?

推荐答案

尽管用于简单删除操作的SQL会无论使用哪种语言和使用哪个数据库,都保持不变,连接到数据库并执行查询的代码将根据您使用的连接到数据库的库而改变.

Though the SQL for a simple delete operation will remain the same no matter what language you use and what database you use, the code to connect to the database and execute the query will change based on which library you''re using to connect to the database.

只需搜索JDBC以及如何连接到数据库,您将获得很多很好的示例.

 Just search for JDBC and how to connect to a database, you''ll get a lot of good examples.


这篇关于通过Java从SQL表中删除一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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