0

I am trying to implement Hikari connection pooling with JAVA 7, spring and Hibernate 5 project. I am getting the below error message continuously on running the code.

Added following code for Hikari set up in addition to already running Spring with hibernate project.

Build.gradle

compile("org.hibernate:hibernate-hikaricp:5.2.10.Final")
compile("com.zaxxer:HikariCP-java7:2.4.12")

DatabaseConfig.java

 final HikariDataSource ds = new HikariDataSource();
      ds.setDriverClassName(env.getProperty("db.driver"));
      ds.setJdbcUrl(env.getProperty("db.url"));
      ds.setUsername(env.getProperty("db.username"));
      ds.setPassword(env.getProperty("db.password"));
      return ds;

Application.properties

hibernate.connection.provider_class=com.zaxxer.hikari.hibernate.HikariConnectionProvider

After adding this project I am getting the below expception on running

org.hibernate.boot.registry.selector.StrategyRegistrationProvider: Provider org.hibernate.hikaricp.internal.StrategyRegistrationProviderImpl not found

Please let me know if you know the Answer.

Prithivi Raj
  • 2,658
  • 1
  • 19
  • 34

1 Answers1

0

If you are using Spring Boot then the property should be like this:

spring.jpa.properties.hibernate.connection.provider_class=com.zaxxer.hikari.hibernate.HikariConnectionProvider

More reading: https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html

Arnold Galovics
  • 3,246
  • 3
  • 22
  • 33