为什么会这样?(oracle数据库连jdbc问题)
sql = "update fs_user a set a.user_name = '1' where a.user_id=?";
PreparedStatement pst = conn.prepareStatement(sql4);
int i=-1;
i = pst.setString(1, "1");
pst.executeUpdate();
System.out.println(i)//打印结果i=1
我用的是oracle的数据库。
此前因为别的原因已经conn.setAutoCommit(false)了。
现在执行后,数据库中的值却没有变。
是不是要conn.commit()?
可是会出错。
究竟该如何使得pst.executeUpdate();能在数据库中被执行?