Classes in the sun.* or com.sun.* packages are considered implementation details, and are not part of the Java API.
They can cause problems when moving to new versions of Java because there is no backwards compatibility guarantee. Similarly, they can cause problems when moving to a different Java vendor, such as OpenJDK.
Such classes are almost always wrapped by Java API classes that should be used instead.
sun.*或com.sun.*包中的类被视为实现细节,而不是Java API的一部分。
当迁移到新版本的Java时,它们可能会导致问题,因为没有向后兼容性保证。类似地,当迁移到其他Java供应商(如OpenJDK)时,它们可能会导致问题。
此类类几乎总是由应该使用的JavaAPI类包装。
CachedRowSetImpl 不应该 使用
CachedRowSet cachedRowSet = new CachedRowSetImpl();
应该使用
CachedRowSet cachedRowSet = RowSetProvider.newFactory().createCachedRowSet();
cachedRowSet.populate(resultSet);