這裏是一個用於存儲數據庫
信息如何快速運行我的項目?
################### JDBC Configuration ##########################
jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/eduman_em?
verifyServerCertificate=false&useSSL=false&requireSSL=false
jdbc.username=root
jdbc.password=1234
########## Hibernate Configuration #########
hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
#### hibernate.show_sql=true
#### hibernate.hbm2ddl.auto=update
#### hibernate.generate_statistics=true
hibernate.connection.charSet=UTF-8
hibernate.ejb.naming_
strategy=org.hibernate.cfg.ImprovedNamingStrategy
hibernate.cache.provider_class=
org.hibernate.cache.HashtableCacheProvider
################## For List insertion Hiber Config
###hibernate.order_inserts=true###
####hibernate.order_updates=true####
This is my **applicationContext-db.xml**
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.2.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.2.xsd">
<!-- Scan for property files -->
<context:property-placeholder location="classpath:META-INF/spring/*.properties"/>
<!-- Transaction Manager -->
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
<property name="dataSource" ref="dataSource" />
</bean>
<!-- Detect @Transactional -->
<tx:annotation-driven transaction-manager="transactionManager" />
<!-- Entity Manager Factory -->
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="jpaVendorAdapter">
<!-- Define Hibernate JPA Vendor Adapter -->
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<!-- <property name="generateDdl" value="true" /> -->
<property name="database" value="MYSQL" />
</bean>
</property>
<!-- Persistence Unit -->
<property name="persistenceUnitName" value="persistenceUnit"/>
</bean>
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource"
p:driverClassName="${jdbc.driverClassName}" p:url="${jdbc.url}"
p:username="${jdbc.username}" p:password="${jdbc.password}" />
<bean
class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="dataSource" />
</bean>
</beans>
我用mysql數據庫我database.properties文件。我的數據庫大小爲552 MB。當我運行我的項目需要5分鐘以上。如果我使用100 MB以下/小型數據庫,那麼它運行得很快。我怎樣才能運行我的項目。 謝謝。
這是認真你的問題?你提供你的數據庫配置,陳述它的大小,並抱怨'項目'速度緩慢,你是否用PrimeFaces標記這個問題?而你的標題'只'表示'春天hibernate jpa',其中只有'hibernate'似乎直接相關。既然你已經有19個聲望點,我100%肯定你可以做得更好,我正在重申你的問題 – Kukeltje
先生,我添加了數據庫配置文件和數據庫大小 –