简体   繁体   中英

How to configure HikariCP with PostgreSQL

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`

我读到了有关的信息,我所做的是使用postgresql-9.4.1208驱动程序和hikaricp 2.4.6替​​换了版本。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM