如何修改SQL表中的数据

来源:百度知道 编辑:UC知道 时间:2024/06/05 23:57:45
例如 表名为 Inventory 修改列名为dsdate 的值为2008-1-1 ,但现在列中是空值

[CODE]
/*******图书信息窗体监听事件*******/
class huan_actionPerformed implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
try
{
String str="jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ=tushuguanli.mdb";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn=DriverManager.getConnection(str);
Statement stmt=conn.createStatement();
if(e.getSource()==bhuan)
{
JOptionPane.showMessageDialog(null,"你要还的书已经提交到数据库,谢谢阅读!","提示",JOptionPane.WARNING_MESSAGE);
/*****先删除原先存在的学号****/
stmt.executeUpdate("delete * from memory where 卡号 = '"+txtnum.getText()+"' and 书名='"+txtbook.getText()+"'");
/***********更新数据并存入到数据库*******/
stmt.executeUpdate("insert into memory values ('"+tnum.getText()+"','"+tbook.getText()+"','"+tautor.getText()+"','&