请告诉我。如何配置“Hikari 连接池 + Hibernate 4.3.8 + Spring Data JPA 配置”?这是我的配置,但出于某种原因,我确信此配置不正确。因为控制台没有出现“连接池”之类的东西。在互联网上我找不到初学者的教程。谢谢。
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
p:dataSource-ref="dataSource" p:packagesToScan="com.history"
p:jpaVendorAdapter-ref="jpaVendorAdapter">
<property name="jpaProperties" ref="hibernateProperties" />
</bean>
<bean id="jpaVendorAdapter"
class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="showSql" value="true" />
<property name="generateDdl" value="true" />
<property name="database" value="ORACLE" />
<property name="databasePlatform" value="org.hibernate.dialect.OracleDialect" />
</bean>
<util:map id="hibernateProperties">
<entry key="hibernate.connection.driver_class"
value="org.hibernate.hikaricp.internal.HikariCPConnectionProvider" />
<entry key="connection.url" value="${dataSource.url}" />
<entry key="connection.driver_class" value="${dataSource.driverClassName}" />
<entry key="connection.username" value="${dataSource.username}" />
<entry key="connection.password" value="${dataSource.password}" />
<entry key="hibernate.jdbc.batch_size" value="100" />
<entry key="hibernate.order_inserts" value="true" />
<entry key="hibernate.order_updates" value="true" />
</util:map>
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="${dataSource.driverClassName}" />
<property name="url" value="${dataSource.url}" />
<property name="username" value="${dataSource.username}" />
<property name="password" value="${dataSource.password}" />
</bean>
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"
p:entityManagerFactory-ref="entityManagerFactory">
</bean>