内部更新

结果集共有三种类型,更新操作在每种类型下,结果集被更新后是否对用户可见也不是完全一样的。表7-1列出了所有的情况。

表7-1

ResultSet Type 可以看到internal-delete后结果 可以看到internal-update后结果 可以看到internal-insert后结果
forward-only
scroll-insensitive
scroll-sensitive

在DatabaseMetaData中也提供了关于察看结果集内部更新后是否对用户可见的方法。

boolean ownDeletesAreVisible(int) throws SQLException

boolean ownInsertsAreVisible(int) throws SQLException

boolean ownUpdatesAreVisible(int) throws SQLException