我注意到如果使用
,我会得到相同的结果 RowSetFactory rowSetFactory = RowSetProvider.newFactory();
和
rowSetFactory = new RowSetFactoryImpl();
newFactory
方法实现:
public static RowSetFactory newFactory()
throws SQLException {
// Use the system property first
RowSetFactory factory = null;
String factoryClassName = null;
try {
trace("Checking for Rowset System Property...");
factoryClassName = getSystemProperty(ROWSET_FACTORY_NAME);
if (factoryClassName != null) {
trace("Found system property, value=" + factoryClassName);
factory = (RowSetFactory) getFactoryClass(factoryClassName, null, true).newInstance();
}
} catch (ClassNotFoundException e) {
throw new SQLException(
"RowSetFactory: " + factoryClassName + " not found", e);
} catch (Exception e) {
throw new SQLException(
"RowSetFactory: " + factoryClassName + " could not be instantiated: " + e,
e);
}
在这里,我们看到此方法返回在system.property中设置的RowSetFactory
。
更改此系统属性的原因是什么?
默认情况下,谁设置此属性?