I was looking into HikariCP for using it in one of my projects. The statement cache section of the project page in github says that it doesn't support prepared statement cache at the connection pool level.
But the initialization section has the below code snippet
HikariConfig config = new HikariConfig();
config.setJdbcUrl("jdbc:mysql://localhost:3306/simpsons");
config.setUsername("bart");
config.setPassword("51mp50n");
config.addDataSourceProperty("cachePrepStmts", "true");
config.addDataSourceProperty("prepStmtCacheSize", "250");
config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
HikariDataSource ds = new HikariDataSource(config);
and it sets prepared statement cache config. Is it being configured for the connection pool or the driver below? Also what are the properties supported by addDataSourceProperty method?
The datasource is configured and used by MySql in your case.
Basically you can send relevant properties to your implementation.
For example for oracle you can send
dataSource.addDataSourceProperty("oracle.jdbc.defaultNChar", "true");
And this property will be used in oracle implementation
HikariCP save it in properties and copy it to driver Properties and use it on connect :
for (Entry<Object, Object> entry : properties.entrySet()) {
driverProperties.setProperty(entry.getKey().toString(), entry.getValue().toString());
}
....
driver.connect(jdbcUrl, driverProperties);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With