首页 数据 > 内容页

executeupdate

时间 : 2023-05-10 09:09:09 来源:互联网


(资料图)

1、这个方法是更新数据库表中的数据时用的,通常用法是这样的:Statement st=conn.createStatement();String sql="update tab1 set score=88 where id=5";//这里是一条SQL,根据实际写int i=st.executeUpdate(sql);//执行。

2、如果i>=1,成功,否则更新失败。

本文为大家分享到这里,希望小伙伴们有帮助。

x