0

I am trying to integrate HikariCP with PostgreSQL in my web application,I am using the postgresql driver and this DataSource class: org.postgresql.ds.PGSimpleDataSource and my hibernate configuration file is this:

<property name ="hibernate.connection.provider_class"> com.zaxxer.hikari.hibernate.HikariConnectionProvider</property>
 <property name ="hibernate.hikari.dataSourceClassName"> org.postgresql.ds.PGSimpleDataSource</property>
 <property name ="hibernate.hikari.dataSource.url">jdbc:postgresql:// localhost:5432/database</property>
 <property name ="hibernate.hikari.dataSource.user">user</property>
 <property name ="hibernate.hikari.dataSource.password">passwd</property>
 <property name ="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
 <property name="hibernate.current_session_context_class">thread</property>

When I run my application i have this exception:

org.hibernate.HibernateException: java.lang.RuntimeException: Property url does not exist on target class org.postgresql.ds.PGSimpleDataSource`

  • Why are you using a datasource through `PGSimpleDataSource`? Shouldn't Hikari take care of providing a DataSource? –  Jan 25 '17 at 07:21
  • Use the Hibernate provided org.hibernate.hikaricp.internal.HikariCPConnectionProvider, the one in HikariCP is deprecated. Also, with the PostgreSQL DataSource you don't need the URL, just set the database name. – brettw Jan 25 '17 at 10:53

1 Answers1

0

I read related information about this and what I did was replace the versions using the postgresql-9.4.1208 driver and hikaricp 2.4.6.