goudai commented on issue #14350:
URL: 
https://github.com/apache/shardingsphere/issues/14350#issuecomment-1001844623


   
   # I used the following configuration and it worked
   
   
![image](https://user-images.githubusercontent.com/16605628/147523546-a08b74f1-ad59-4f62-a72f-9f13ad0d6cae.png)
   
   ```java
   public  class HikariJDBCParameterDecorator implements 
JDBCParameterDecorator<HikariDataSource> {
       
       @Override
       public HikariDataSource decorate(final HikariDataSource dataSource) {
           final ConnectionUrlParser connectionUrlParser = 
ConnectionUrlParser.parseConnectionString(dataSource.getJdbcUrl());
   
           Map<String, String> urlProps = connectionUrlParser.getProperties();
           addJDBCProperty(dataSource, urlProps, "useServerPrepStmts", 
Boolean.TRUE.toString());
           addJDBCProperty(dataSource, urlProps, "cachePrepStmts", 
Boolean.TRUE.toString());
           addJDBCProperty(dataSource, urlProps, "prepStmtCacheSize", "200000");
           addJDBCProperty(dataSource, urlProps, "prepStmtCacheSqlLimit", 
"2048");
           HikariDataSource result = new HikariDataSource(dataSource);
           dataSource.close();
           return result;
       }
       
       private void addJDBCProperty(final HikariConfig config, final 
Map<String, String> urlProps, final String key, final String value) {
           if (urlProps.isEmpty() || !urlProps.containsKey(key)) {
               config.getDataSourceProperties().setProperty(key, value);
           }
       }
       
       @Override
       public Class<HikariDataSource> getType() {
           return HikariDataSource.class;
       }
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to