在声明 setExplicitCachingEnabled(true)
(或 setImplicitCachingEnabled(true)
)之后,关于 JDBC 连接的内存/性能,有什么需要注意的吗?
最佳答案
要在 OracleDataSource 对象上启用隐式语句缓存,您需要执行以下步骤:
调用 OracleDataSource.getConnection() 并将 ImplicitCachingEnabled 属性设置为 true,或通过调用 OracleDataSource.setImplicitCachingEanble(true) 在 OracleDataSource 上设置 ImplicitCachingEnabled;
通过调用 OracleDataSource.setMaxStatements(int maxNumberOfStatements) 设置缓存大小 例如:OracleDataSource.setMaxStatements(10);
关于java - JDBC setExplicitCachingEnabled(true) - 性能/内存问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17863506/