如何使用 PostgreSQL 配置 HikariCP

How to configure HikariCP with PostgreSQL

我正在尝试在我的 Web 应用程序中将 HikariCP 与 PostgreSQL 集成,我正在使用 postgresql 驱动程序和这个数据源 class: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>

当我 运行 我的应用程序出现此异常时:

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 替换版本。