Skip to content

Instantly share code, notes, and snippets.

@jeevan-patil
Created July 29, 2017 08:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeevan-patil/a5acfc5e22b8254b3019bcab10768207 to your computer and use it in GitHub Desktop.
Save jeevan-patil/a5acfc5e22b8254b3019bcab10768207 to your computer and use it in GitHub Desktop.
HikariCP connection pool configuration
<bean id="hikariConfig" class="com.zaxxer.hikari.HikariConfig">
<property name="poolName" value="mercatus_connection_pool" />
<property name="dataSourceClassName" value="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"/>
<property name="maximumPoolSize" value="50" />
<property name="maxLifetime" value="60000" />
<property name="idleTimeout" value="30000" />
<property name="dataSourceProperties">
<props>
<prop key="url">${jdbc.url}</prop>
<prop key="user">${jdbc.username}</prop>
<prop key="password">${jdbc.password}</prop>
<prop key="prepStmtCacheSize">250</prop>
<prop key="prepStmtCacheSqlLimit">2048</prop>
<prop key="cachePrepStmts">true</prop>
<prop key="useServerPrepStmts">true</prop>
</props>
</property>
</bean>
<bean id="dataSource" class="com.zaxxer.hikari.HikariDataSource" destroy-method="close">
<constructor-arg ref="hikariConfig" />
</bean>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment