0

I'm trying to use HikariCP with Spring on Java 7

Spring conifg:

<bean 
    id="DBDataSource"
    class="com.zaxxer.hikari.HikariConfig" 
    lazy-init="true">
    <property name="driverClassName" value="${SMSLAIDB.driverClassName}"/>
    <property name="jdbcUrl" value="${DB.connectionUrl}"/>
    <property name="username" value="${DB.username}"/>
    <property name="password" value="${DB.password}"/>
    <property name="connectionTestQuery" value="SELECT 1" />

</bean>

and calling with this

<property name="dataSource" ref="DBDataSource"/>

Hibernate properties:

    <property name="hibernateProperties">
        <props>
            <prop key="hibernate.connection.provider_class">com.zaxxer.hikari.hibernate.HikariConnectionProvider</prop>
            <prop key="hibernate.dialect">${DB.dialect}</prop>
            <prop key="hibernate.transaction.factory_class">
                org.hibernate.transaction.JDBCTransactionFactory
            </prop>
            <prop key="hibernate.current_session_context_class">thread</prop>

        </props> 
    </property>

It gives me an error:

 Cannot convert value of type [com.zaxxer.hikari.HikariConfig] to required type [javax.sql.DataSource] for property 'dataSource'
Dekso
  • 541
  • 4
  • 23

0 Answers0