I recently switched my Spring RESTful API data source from DriverManagerDataSource to HikariCp, but my database connections went from 20 connections to 600 connections. Is this suppose to happen?
My settings are as follows:
<bean id="jdbcDataSource"
class="com.zaxxer.hikari.HikariDataSource" destroy-method="shutdown">
<constructor-arg>
<bean class="com.zaxxer.hikari.HikariConfig">
<constructor-arg>
<props>
<prop key="dataSource.url">url</prop>
<prop key="dataSource.user">user</prop>
<prop key="dataSource.password">password</prop>
<prop key="dataSource.cachePrepStmts">true</prop>
<prop key="dataSource.prepStmtCacheSize">250</prop>
<prop key="dataSource.prepStmtCacheSqlLimit">2048</prop>
<prop key="dataSource.useServerPrepStmts">true</prop>
</props>
</constructor-arg>
<property name="dataSourceClassName" value="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" />
</bean>
</constructor-arg>
</bean>
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="jdbcDataSource" />
</bean>