java 修改sql数据库的语句是什么啊??

来源:百度知道 编辑:UC知道 时间:2024/05/16 15:52:08
比如说:旧记录更换为新纪录,该怎么写??

update table set 列名=更新值 [where 条件]

update 表名 set 列名=更新值 where 查询条件
例如:把Employee表中的名为张三的EmployeeID的值更改为1,就要写到

update Employee set EmployeeID=1 where Name='张三'

import java.sql.*;

public class DBUtil{
public static void main(String[] args)throws Exception{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:jsql");
PreparedStatement pst=con.prepareStatement("insert iotn jobs ('dddddd','1','1')");
pst.executeUpdate();
pst.close();
con.close();
}
}

update table set 列名=更新值 [where 条件] 感觉楼上说对了
有外联另外说...

。。。update