简体   繁体   English

如何使用PostgreSQL配置HikariCP

[英]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: 我正在尝试将HikariCP与PostgreSQL集成到我的Web应用程序中,正在使用postgresql驱动程序和以下DataSource类:org.postgresql.ds.PGSimpleDataSource,我的休眠配置文件是这样的:

<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` org.hibernate.HibernateException:java.lang.RuntimeException:目标类org.postgresql.ds.PGSimpleDataSource`上不存在属性url。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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