0

I can't figure out how to set MaxPooledStatements in Oracle using the Oracle thin JDBC driver. Could someone point me in the right direction?

2 Answers 2

1

This should work:

Properties p = new Properties();
p.setProperty("user", userid);
p.setProperty("password", password);
p.setProperty("MaxPooledStatements", "200");
// set other properties 
Connection conn = driver.connect(url, p);  // can also use DriverManager but no real benefit
0

I'd suggest you read more about statement pooling with Oracle. For instance here

Although Oracle JDBC drivers are designed with the supposition that implicit caching is enabled, this feature is not turned on by default. To enable implicit caching on the connection, you can set the implicitCachingEnabled property of the corresponding OracleConnection object to true and set the statementCacheSize property to a positive integer. This can be done as follows:

  conn.setImplicitCachingEnabled(true);
  conn.setStatementCacheSize(10);

When using aUCP JDBC connection pool, you can enable statement caching by setting maxStatements property to a positive integer:

  pds.setMaxStatements(10); 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.