【发布时间】:2012-03-23 16:12:01
【问题描述】:
如果我们要在数据库中添加新数据,我们使用类似这样的东西
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection(
"jdbc:mysql://mysql.cityu.edu.hk:3306/", "yyy", "xxx");
stmt = con.createStatement();
stmt.execute("USE yyy");
id = (String) request.getParameter("id");
text = (String) request.getParameter("text");
time = (String) request.getParameter("time");
query="insert into Table values(0,'" + id + "', 'ABC' ,'" + text + "','" + time + "');";
int rs = stmt.executeUpdate(query);
但是如果我们要编辑/删除数据库中的某些内容呢?任何教程?非常感谢!干杯!
【问题讨论】: